revolt.js

revolt.js

Warning revolt.js is currently being rewritten, it's pretty much ready for use for most applications but is still not entirely feature complete.

You can find the version 6 README here.

revolt.js revolt-api

revolt.js is a JavaScript library for interacting with the entire Revolt API.

Example Usage

// esm / typescript
import { Client } from "revolt.js";
// ...or commonjs
const { Client } = require("revolt.js");

let client = new Client();

client.on("ready", async () =>
console.info(`Logged in as ${client.user.username}!`)
);

client.on("messageCreate", async (message) => {
if (message.content === "hello") {
message.channel.sendMessage("world");
}
});

client.loginBot("..");

Reactivity with Signals & Solid.js Primitives

All objects have reactivity built-in and can be dropped straight into any Solid.js project.

const client = new Client();
// initialise the client

function MyApp() {
return (
<h1>Your username is: {client.user?.username ?? "[logging in...]"}</h1>
);
}

Revolt API Types

All revolt-api types are re-exported from this library under API.

Warning It is advised you do not use this unless necessary, if you find somewhere that isn't covered by the library, please open an issue as this library aims to transform all objects.

import { API } from "revolt.js";

// API.Channel;
// API.[..];

Generated using TypeDoc

revolt.js

Index

Namespaces

Enumerations

Classes

Type Aliases

Variables

Generated using TypeDoc

Class API

API Client

Hierarchy

  • API

Constructors

Properties

Accessors

Methods

Constructors

  • Parameters

    • Optional __namedParameters: Partial<Options>

    Returns API

Properties

authentication: any
baseURL: any

Accessors

  • get auth(): AxiosRequestConfig<any>
  • Generate authentication options.

    Returns AxiosRequestConfig<any>

  • get config(): AxiosRequestConfig<any>
  • Generate config to pass through to API.

    Returns AxiosRequestConfig<any>

Methods

  • Send HTTP DELETE request.

    Returns

    Typed Response Data

    Type Parameters

    • Path extends "/auth/mfa/totp" | `/bots/${string}` | "-/bots/{target}" | `/channels/${string}` | "-/channels/{target}" | `/channels/${string}/messages/${string}` | "-/channels/{target}/messages/{msg}" | `/servers/${string}` | "-/servers/{target}" | `/servers/${string}/members/${string}` | "-/servers/{target}/members/{member}" | `/invites/${string}` | "-/invites/{target}" | `/custom/emoji/${string}` | "-/custom/emoji/{id}" | `/users/${string}/friend` | "-/users/{target}/friend" | `/users/${string}/block` | "-/users/{target}/block" | `/channels/${string}/messages/bulk` | "-/channels/{target}/messages/bulk" | `/channels/${string}/recipients/${string}` | "-/channels/{target}/recipients/{member}" | `/channels/${string}/messages/${string}/reactions/${string}` | "-/channels/{target}/messages/{msg}/reactions/{emoji}" | `/channels/${string}/messages/${string}/reactions` | "-/channels/{target}/messages/{msg}/reactions" | `/servers/${string}/bans/${string}` | "-/servers/{server}/bans/{target}" | `/servers/${string}/roles/${string}` | "-/servers/{target}/roles/{role_id}" | `/auth/session/${string}` | "-/auth/session/{id}"

    • Route extends APIRoutes & {
          method: "delete";
      } & {
          parts: Count<Path, "/", []>;
          path: Path;
      }

    Parameters

    • path: Path

      Path

    • Optional params: any

      Body or Query Parameters

    • Optional config: AxiosRequestConfig<any>

      Axios configuration

    Returns Promise<Route["response"]>

  • Send HTTP DELETE request.

    Returns

    Typed Response Data

    Type Parameters

    • Path extends "/auth/mfa/totp" | `/bots/${string}` | "-/bots/{target}" | `/channels/${string}/messages/${string}` | "-/channels/{target}/messages/{msg}" | `/servers/${string}/members/${string}` | "-/servers/{target}/members/{member}" | `/invites/${string}` | "-/invites/{target}" | `/custom/emoji/${string}` | "-/custom/emoji/{id}" | `/users/${string}/friend` | "-/users/{target}/friend" | `/users/${string}/block` | "-/users/{target}/block" | `/channels/${string}/recipients/${string}` | "-/channels/{target}/recipients/{member}" | `/channels/${string}/messages/${string}/reactions` | "-/channels/{target}/messages/{msg}/reactions" | `/servers/${string}/bans/${string}` | "-/servers/{server}/bans/{target}" | `/servers/${string}/roles/${string}` | "-/servers/{target}/roles/{role_id}" | `/auth/session/${string}` | "-/auth/session/{id}"

    • Route extends APIRoutes & {
          method: "delete";
      } & {
          parts: Count<Path, "/", []>;
          path: Path;
      }

    Parameters

    • path: Path

      Path

    • Optional params: any

      Body or Query Parameters

    Returns Promise<Route["response"]>

  • Send HTTP GET request.

    Returns

    Typed Response Data

    Type Parameters

    • Path extends "/auth/session/all" | "/" | "/admin/stats" | `/users/${string}` | "-/users/{target}" | `/users/${string}/flags` | "-/users/{target}/flags" | `/users/${string}/default_avatar` | "-/users/{target}/default_avatar" | `/users/${string}/profile` | "-/users/{target}/profile" | `/users/${string}/dm` | "-/users/{target}/dm" | `/users/${string}/mutual` | "-/users/{target}/mutual" | `/bots/${string}/invite` | "-/bots/{target}/invite" | `/bots/${string}` | "-/bots/{target}" | `/channels/${string}` | "-/channels/{target}" | `/channels/${string}/members` | "-/channels/{target}/members" | `/channels/${string}/messages/${string}` | "-/channels/{target}/messages/{msg}" | `/servers/${string}` | "-/servers/{target}" | `/servers/${string}/members/${string}` | "-/servers/{target}/members/{member}" | `/servers/${string}/bans` | "-/servers/{target}/bans" | `/servers/${string}/invites` | "-/servers/{target}/invites" | `/servers/${string}/emojis` | "-/servers/{target}/emojis" | `/invites/${string}` | "-/invites/{target}" | `/custom/emoji/${string}` | "-/custom/emoji/{id}" | `/safety/report/${string}` | "-/safety/report/{id}" | "/safety/reports" | `/safety/snapshot/${string}` | "-/safety/snapshot/{report_id}" | "/auth/account/" | "/auth/mfa/" | "/auth/mfa/methods" | "/onboard/hello" | "/sync/unreads" | `/channels/${string}/messages` | "-/channels/{target}/messages" | `/servers/${string}/members` | "-/servers/{target}/members"

    • Route extends APIRoutes & {
          method: "get";
      } & {
          parts: Count<Path, "/", []>;
          path: Path;
      }

    Parameters

    • path: Path

      Path

    • params: Route["params"]

      Body or Query Parameters

    • Optional config: AxiosRequestConfig<any>

      Axios configuration

    Returns Promise<Route["response"]>

  • Send HTTP GET request.

    Returns

    Typed Response Data

    Type Parameters

    • Path extends "/auth/session/all" | "/" | "/admin/stats" | `/users/${string}` | "-/users/{target}" | `/users/${string}/flags` | "-/users/{target}/flags" | `/users/${string}/default_avatar` | "-/users/{target}/default_avatar" | `/users/${string}/profile` | "-/users/{target}/profile" | `/users/${string}/dm` | "-/users/{target}/dm" | `/users/${string}/mutual` | "-/users/{target}/mutual" | `/bots/${string}/invite` | "-/bots/{target}/invite" | `/bots/${string}` | "-/bots/{target}" | `/channels/${string}` | "-/channels/{target}" | `/channels/${string}/members` | "-/channels/{target}/members" | `/channels/${string}/messages/${string}` | "-/channels/{target}/messages/{msg}" | `/servers/${string}` | "-/servers/{target}" | `/servers/${string}/members/${string}` | "-/servers/{target}/members/{member}" | `/servers/${string}/bans` | "-/servers/{target}/bans" | `/servers/${string}/invites` | "-/servers/{target}/invites" | `/servers/${string}/emojis` | "-/servers/{target}/emojis" | `/invites/${string}` | "-/invites/{target}" | `/custom/emoji/${string}` | "-/custom/emoji/{id}" | `/safety/report/${string}` | "-/safety/report/{id}" | "/safety/reports" | `/safety/snapshot/${string}` | "-/safety/snapshot/{report_id}" | "/auth/account/" | "/auth/mfa/" | "/auth/mfa/methods" | "/onboard/hello" | "/sync/unreads"

    • Route extends APIRoutes & {
          method: "get";
      } & {
          parts: Count<Path, "/", []>;
          path: Path;
      }

    Parameters

    • path: Path

      Path

    Returns Promise<Route["response"]>

  • Send HTTP PATCH request.

    Returns

    Typed Response Data

    Type Parameters

    • Path extends "/auth/account/change/password" | "/auth/account/change/email" | "/auth/account/reset_password" | `/users/${string}` | "-/users/{target}" | `/bots/${string}` | "-/bots/{target}" | `/channels/${string}` | "-/channels/{target}" | `/channels/${string}/messages/${string}` | "-/channels/{target}/messages/{msg}" | `/servers/${string}` | "-/servers/{target}" | `/servers/${string}/members/${string}` | "-/servers/{server}/members/{target}" | `/servers/${string}/roles/${string}` | "-/servers/{target}/roles/{role_id}" | `/safety/reports/${string}` | "-/safety/reports/{report}" | `/auth/session/${string}` | "-/auth/session/{id}" | "/auth/mfa/recovery"

    • Route extends APIRoutes & {
          method: "patch";
      } & {
          parts: Count<Path, "/", []>;
          path: Path;
      }

    Parameters

    • path: Path

      Path

    • params: Route["params"]

      Body or Query Parameters

    • Optional config: AxiosRequestConfig<any>

      Axios configuration

    Returns Promise<Route["response"]>

  • Send HTTP PATCH request.

    Returns

    Typed Response Data

    Type Parameters

    • Path extends "/auth/mfa/recovery"

    • Route extends APIRoutes & {
          method: "patch";
      } & {
          parts: Count<Path, "/", []>;
          path: Path;
      }

    Parameters

    • path: Path

      Path

    Returns Promise<Route["response"]>

  • Send HTTP POST request.

    Returns

    Typed Response Data

    Type Parameters

    • Path extends "/admin/messages" | "/users/friend" | "/bots/create" | "/channels/create" | "/servers/create" | "/safety/report" | "/auth/account/create" | "/auth/account/reverify" | "/auth/account/delete" | "/auth/account/reset_password" | "/auth/session/login" | "/auth/mfa/totp" | "/onboard/complete" | "/push/subscribe" | "/sync/settings/fetch" | "/sync/settings/set" | `/bots/${string}/invite` | "-/bots/{target}/invite" | `/invites/${string}` | "-/invites/{target}" | `/channels/${string}/invites` | "-/channels/{target}/invites" | `/channels/${string}/messages` | "-/channels/{target}/messages" | `/channels/${string}/search` | "-/channels/{target}/search" | `/channels/${string}/messages/stale` | "-/channels/{_target}/messages/stale" | `/channels/${string}/join_call` | "-/channels/{target}/join_call" | `/servers/${string}/channels` | "-/servers/{target}/channels" | `/servers/${string}/roles` | "-/servers/{target}/roles" | "/auth/account/disable" | `/auth/account/verify/${string}` | "-/auth/account/verify/{code}" | "/auth/session/logout" | "/auth/mfa/recovery" | "/push/unsubscribe"

    • Route extends APIRoutes & {
          method: "post";
      } & {
          parts: Count<Path, "/", []>;
          path: Path;
      }

    Parameters

    • path: Path

      Path

    • params: Route["params"]

      Body or Query Parameters

    • Optional config: AxiosRequestConfig<any>

      Axios configuration

    Returns Promise<Route["response"]>

  • Send HTTP POST request.

    Returns

    Typed Response Data

    Type Parameters

    • Path extends "/auth/account/delete" | "/auth/mfa/totp" | `/invites/${string}` | "-/invites/{target}" | `/channels/${string}/invites` | "-/channels/{target}/invites" | `/channels/${string}/join_call` | "-/channels/{target}/join_call" | "/auth/account/disable" | `/auth/account/verify/${string}` | "-/auth/account/verify/{code}" | "/auth/session/logout" | "/auth/mfa/recovery" | "/push/unsubscribe"

    • Route extends APIRoutes & {
          method: "post";
      } & {
          parts: Count<Path, "/", []>;
          path: Path;
      }

    Parameters

    • path: Path

      Path

    Returns Promise<Route["response"]>

  • Send HTTP PUT request.

    Returns

    Typed Response Data

    Type Parameters

    • Path extends "/auth/account/delete" | "/auth/mfa/ticket" | "/auth/mfa/totp" | `/custom/emoji/${string}` | "-/custom/emoji/{id}" | `/users/${string}/friend` | "-/users/{target}/friend" | `/users/${string}/block` | "-/users/{target}/block" | `/channels/${string}/ack/${string}` | "-/channels/{target}/ack/{message}" | `/channels/${string}/recipients/${string}` | "-/channels/{target}/recipients/{member}" | `/channels/${string}/permissions/${string}` | "-/channels/{target}/permissions/{role_id}" | `/channels/${string}/permissions/default` | "-/channels/{target}/permissions/default" | `/channels/${string}/messages/${string}/reactions/${string}` | "-/channels/{target}/messages/{msg}/reactions/{emoji}" | `/servers/${string}/ack` | "-/servers/{target}/ack" | `/servers/${string}/bans/${string}` | "-/servers/{server}/bans/{target}" | `/servers/${string}/permissions/${string}` | "-/servers/{target}/permissions/{role_id}" | `/servers/${string}/permissions/default` | "-/servers/{target}/permissions/default"

    • Route extends APIRoutes & {
          method: "put";
      } & {
          parts: Count<Path, "/", []>;
          path: Path;
      }

    Parameters

    • path: Path

      Path

    • params: Route["params"]

      Body or Query Parameters

    • Optional config: AxiosRequestConfig<any>

      Axios configuration

    Returns Promise<Route["response"]>

  • Send HTTP PUT request.

    Returns

    Typed Response Data

    Type Parameters

    • Path extends `/users/${string}/friend` | "-/users/{target}/friend" | `/users/${string}/block` | "-/users/{target}/block" | `/channels/${string}/ack/${string}` | "-/channels/{target}/ack/{message}" | `/channels/${string}/recipients/${string}` | "-/channels/{target}/recipients/{member}" | `/channels/${string}/messages/${string}/reactions/${string}` | "-/channels/{target}/messages/{msg}/reactions/{emoji}" | `/servers/${string}/ack` | "-/servers/{target}/ack"

    • Route extends APIRoutes & {
          method: "put";
      } & {
          parts: Count<Path, "/", []>;
          path: Path;
      }

    Parameters

    • path: Path

      Path

    Returns Promise<Route["response"]>

  • Send any arbitrary request.

    Returns

    Typed Response Data

    Type Parameters

    • Method extends "get" | "delete" | "post" | "patch" | "put"

    • Routes extends PickRoutes<Method>

    • Path extends "/admin/messages" | "/safety/report" | "/auth/account/create" | "/auth/account/reverify" | "/auth/account/delete" | "/auth/account/change/password" | "/auth/account/change/email" | "/auth/account/reset_password" | "/auth/mfa/ticket" | "/auth/mfa/totp" | "/onboard/complete" | "/push/subscribe" | "/sync/settings/fetch" | "/sync/settings/set" | "/" | "/admin/stats" | `/users/${string}` | "-/users/{target}" | `/users/${string}/flags` | "-/users/{target}/flags" | `/users/${string}/default_avatar` | "-/users/{target}/default_avatar" | `/users/${string}/profile` | "-/users/{target}/profile" | `/users/${string}/dm` | "-/users/{target}/dm" | `/users/${string}/mutual` | "-/users/{target}/mutual" | `/bots/${string}/invite` | "-/bots/{target}/invite" | `/bots/${string}` | "-/bots/{target}" | `/channels/${string}` | "-/channels/{target}" | `/channels/${string}/members` | "-/channels/{target}/members" | `/channels/${string}/messages/${string}` | "-/channels/{target}/messages/{msg}" | `/servers/${string}` | "-/servers/{target}" | `/servers/${string}/members/${string}` | "-/servers/{target}/members/{member}" | `/servers/${string}/bans` | "-/servers/{target}/bans" | `/servers/${string}/invites` | "-/servers/{target}/invites" | `/servers/${string}/emojis` | "-/servers/{target}/emojis" | `/invites/${string}` | "-/invites/{target}" | `/custom/emoji/${string}` | "-/custom/emoji/{id}" | `/safety/report/${string}` | "-/safety/report/{id}" | "/safety/reports" | `/safety/snapshot/${string}` | "-/safety/snapshot/{report_id}" | "/auth/account/" | "/auth/mfa/" | "/auth/mfa/methods" | "/onboard/hello" | "/sync/unreads" | `/users/${string}/friend` | "-/users/{target}/friend" | `/users/${string}/block` | "-/users/{target}/block" | `/channels/${string}/ack/${string}` | "-/channels/{target}/ack/{message}" | `/channels/${string}/invites` | "-/channels/{target}/invites" | `/channels/${string}/messages` | "-/channels/{target}/messages" | `/channels/${string}/search` | "-/channels/{target}/search" | `/channels/${string}/messages/stale` | "-/channels/{_target}/messages/stale" | `/channels/${string}/messages/bulk` | "-/channels/{target}/messages/bulk" | `/channels/${string}/recipients/${string}` | "-/channels/{target}/recipients/{member}" | `/channels/${string}/join_call` | "-/channels/{target}/join_call" | `/channels/${string}/permissions/${string}` | "-/channels/{target}/permissions/{role_id}" | `/channels/${string}/permissions/default` | "-/channels/{target}/permissions/default" | `/channels/${string}/messages/${string}/reactions/${string}` | "-/channels/{target}/messages/{msg}/reactions/{emoji}" | `/channels/${string}/messages/${string}/reactions` | "-/channels/{target}/messages/{msg}/reactions" | `/servers/${string}/ack` | "-/servers/{target}/ack" | `/servers/${string}/channels` | "-/servers/{target}/channels" | `/servers/${string}/members` | "-/servers/{target}/members" | "-/servers/{server}/members/{target}" | `/servers/${string}/bans/${string}` | "-/servers/{server}/bans/{target}" | `/servers/${string}/roles` | "-/servers/{target}/roles" | `/servers/${string}/roles/${string}` | "-/servers/{target}/roles/{role_id}" | `/servers/${string}/permissions/${string}` | "-/servers/{target}/permissions/{role_id}" | `/servers/${string}/permissions/default` | "-/servers/{target}/permissions/default" | `/safety/reports/${string}` | "-/safety/reports/{report}" | "/auth/account/disable" | `/auth/account/verify/${string}` | "-/auth/account/verify/{code}" | `/auth/session/${string}` | "-/auth/session/{id}" | "/auth/mfa/recovery" | "/push/unsubscribe"

    • Route extends Object

    Parameters

    • method: Method

      HTTP Method

    • path: Path

      Path

    • params: Route["params"]

      Body or Query Parameters

    • Optional config: AxiosRequestConfig<any>

      Axios configuration

    Returns Promise<Route["response"]>

Generated using TypeDoc

Class Bot

Bot Class

Hierarchy

  • Bot

Constructors

Properties

#collection: BotCollection
id: string

Accessors

  • get analytics(): boolean
  • Whether this bot has analytics enabled

    Returns boolean

  • get createdAt(): Date
  • Time when this user created their account

    Returns Date

  • get discoverable(): boolean
  • Whether this bot shows up on Discover

    Returns boolean

  • get interactionsUrl(): undefined | string
  • Interactions URL

    Returns undefined | string

  • get privacyPolicyUrl(): undefined | string
  • Link to privacy policy

    Returns undefined | string

  • get public(): boolean
  • Whether this bot can be invited by anyone

    Returns boolean

  • get termsOfServiceUrl(): undefined | string
  • Link to terms of service

    Returns undefined | string

Methods

  • Edit a bot

    Parameters

    • data: {
          analytics?: null | boolean;
          interactions_url?: null | string;
          name?: null | string;
          public?: null | boolean;
          remove?: null | ("Token" | "InteractionsURL")[];
      }

      Changes

      • Optional analytics?: null | boolean

        Description

        Whether analytics should be gathered for this bot

        Must be enabled in order to show up on Revolt Discover.

      • Optional interactions_url?: null | string

        Description

        Interactions URL

      • Optional name?: null | string

        Description

        Bot username

      • Optional public?: null | boolean

        Description

        Whether the bot can be added by anyone

      • Optional remove?: null | ("Token" | "InteractionsURL")[]

        Description

        Fields to remove from bot object

    Returns Promise<void>

Generated using TypeDoc

Class BotCollection

Collection of Bots

Hierarchy

Constructors

Properties

#objects: ReactiveMap<string, Bot> = ...
#storage: ObjectStorage<HydratedBot> = ...
client: Client
getUnderlyingObject: ((id: string) => HydratedBot)

Type declaration

    • (id: string): HydratedBot
    • Parameters

      • id: string

      Returns HydratedBot

updateUnderlyingObject: SetStoreFunction<Record<string, HydratedBot>>

Methods

  • Create a new instance of an object

    Parameters

    • id: string

      Id

    • type: "channel" | "user" | "server" | "bot" | "channelUnread" | "emoji" | "message" | "serverMember"

      Type

    • instance: Bot

      Instance

    • context: unknown

      Context

    • Optional data: unknown

      Data

    Returns void

  • Filter the collection by a given predicate

    Parameters

    • predicate: ((value: Bot, key: string) => boolean)

      Predicate to satisfy

        • (value: Bot, key: string): boolean
        • Parameters

          • value: Bot
          • key: string

          Returns boolean

    Returns Bot[]

  • Find some value based on a predicate

    Parameters

    • predicate: ((value: Bot, key: string) => boolean)

      Predicate to satisfy

        • (value: Bot, key: string): boolean
        • Parameters

          • value: Bot
          • key: string

          Returns boolean

    Returns undefined | Bot

  • Execute a provided function over each key, value pair in the map

    Returns

    Iterable

    Parameters

    • cb: ((value: Bot, key: string, map: ReactiveMap<string, Bot>) => void)

      Callback for each pair

        • (value: Bot, key: string, map: ReactiveMap<string, Bot>): void
        • Parameters

          • value: Bot
          • key: string
          • map: ReactiveMap<string, Bot>

          Returns void

    Returns void

  • Get or create

    Returns

    Bot

    Parameters

    • id: string

      Id

    • data: {
          _id: string;
          analytics?: boolean;
          discoverable?: boolean;
          flags?: null | number;
          interactions_url?: null | string;
          owner: string;
          privacy_policy_url?: null | string;
          public: boolean;
          terms_of_service_url?: null | string;
          token: string;
      }

      Data

      • _id: string

        Description

        Bot Id

        This equals the associated bot user's id.

      • Optional analytics?: boolean

        Description

        Whether to enable analytics

      • Optional discoverable?: boolean

        Description

        Whether this bot should be publicly discoverable

      • Optional flags?: null | number

        Format: int32

        Description

        Enum of bot flags

      • Optional interactions_url?: null | string

        Description

        Reserved; URL for handling interactions

      • owner: string

        Description

        User Id of the bot owner

      • Optional privacy_policy_url?: null | string

        Description

        URL for privacy policy

      • public: boolean

        Description

        Whether the bot is public (may be invited by anyone)

      • Optional terms_of_service_url?: null | string

        Description

        URL for terms of service

      • token: string

        Description

        Token used to authenticate requests for this bot

    Returns Bot

  • Map the collection using a given callback

    Type Parameters

    • O

    Parameters

    • cb: ((value: Bot, key: string) => O)

      Callback

        • (value: Bot, key: string): O
        • Parameters

          • value: Bot
          • key: string

          Returns O

    Returns O[]

Generated using TypeDoc

Class Channel

Channel Class

Hierarchy

  • Channel

Constructors

Properties

#ackLimit?: number
#ackTimeout?: number
#collection: ChannelCollection
id: string

Accessors

  • get animatedIconURL(): undefined | string
  • URL to the animated channel icon

    Returns undefined | string

  • get defaultPermissions(): undefined | {
        a: number;
        d: number;
    }
  • Default permissions for this server channel

    Returns undefined | {
        a: number;
        d: number;
    }

  • get lastMessageAt(): undefined | Date
  • Time when the last message was sent

    Returns undefined | Date

  • get lastMessageId(): undefined | string
  • ID of the last message sent in this channel

    Returns undefined | string

  • get mentions(): undefined | ReactiveSet<string>
  • Get mentions in this channel for user.

    Returns undefined | ReactiveSet<string>

  • get permission(): number
  • Permission the currently authenticated user has against this channel

    Returns number

  • get permissions(): undefined | number
  • Permissions allowed for users in this group

    Returns undefined | number

  • get recipientIds(): ReactiveSet<string>
  • User ids of recipients of the group

    Returns ReactiveSet<string>

  • get rolePermissions(): undefined | Record<string, {
        a: number;
        d: number;
    }>
  • Role permissions for this server channel

    Returns undefined | Record<string, {
        a: number;
        d: number;
    }>

  • get smallIconURL(): undefined | string
  • URL to a small variant of the channel icon

    Returns undefined | string

  • get type(): "SavedMessages" | "DirectMessage" | "Group" | "TextChannel" | "VoiceChannel"
  • Channel type

    Returns "SavedMessages" | "DirectMessage" | "Group" | "TextChannel" | "VoiceChannel"

  • get typingIds(): ReactiveSet<string>
  • User ids of people currently typing in channel

    Returns ReactiveSet<string>

  • get updatedAt(): Date
  • Time when the channel was last updated (either created or a message was sent)

    Returns Date

Methods

  • Mark a channel as read

    Requires

    SavedMessages, DirectMessage, Group, TextChannel

    Parameters

    • Optional message: string | Message

      Last read message or its ID

    • Optional skipRateLimiter: boolean

      Whether to skip the internal rate limiter

    Returns Promise<void>

  • Add a user to a group

    Requires

    Group

    Parameters

    • user_id: string

      ID of the target user

    Returns Promise<undefined>

  • Create an invite to the channel

    Requires

    TextChannel, VoiceChannel

    Returns

    Newly created invite code

    Returns Promise<{
        _id: string;
        channel: string;
        creator: string;
        server: string;
        type: "Server";
    } | {
        _id: string;
        channel: string;
        creator: string;
        type: "Group";
    }>

  • Delete or leave a channel

    Requires

    DirectMessage, Group, TextChannel, VoiceChannel

    Parameters

    • Optional leaveSilently: boolean

      Whether to not send a message on leave

    Returns Promise<void>

  • Delete many messages by their IDs

    Requires

    SavedMessages, DirectMessage, Group, TextChannel

    Parameters

    • ids: string[]

      List of message IDs

    Returns Promise<void>

  • Edit a channel

    Parameters

    • data: {
          archived?: null | boolean;
          description?: null | string;
          icon?: null | string;
          name?: null | string;
          nsfw?: null | boolean;
          owner?: null | string;
          remove?: null | ("Description" | "Icon" | "DefaultPermissions")[];
      }

      Changes

      • Optional archived?: null | boolean

        Description

        Whether this channel is archived

      • Optional description?: null | string

        Description

        Channel description

      • Optional icon?: null | string

        Description

        Icon

        Provide an Autumn attachment Id.

      • Optional name?: null | string

        Description

        Channel name

      • Optional nsfw?: null | boolean

        Description

        Whether this channel is age-restricted

      • Optional owner?: null | string

        Description

        Group owner

      • Optional remove?: null | ("Description" | "Icon" | "DefaultPermissions")[]

    Returns Promise<void>

  • Fetch a channel's members.

    Requires

    Group

    Returns

    An array of the channel's members.

    Returns Promise<User[]>

  • Fetch a message by its ID

    Requires

    SavedMessages, DirectMessage, Group, TextChannel

    Returns

    Message

    Parameters

    • messageId: string

      ID of the target message

    Returns Promise<Message>

  • Fetch multiple messages from a channel

    Requires

    SavedMessages, DirectMessage, Group, TextChannel

    Returns

    Messages

    Parameters

    • Optional params: Omit<undefined | {
          after?: null | string;
          before?: null | string;
          include_users?: null | boolean;
          limit?: null | number;
          nearby?: null | string;
          sort?: null | "Relevance" | "Latest" | "Oldest";
      }, "include_users">

      Message fetching route data

    Returns Promise<Message[]>

  • Fetch multiple messages from a channel including the users that sent them

    Requires

    SavedMessages, DirectMessage, Group, TextChannel

    Returns

    Object including messages and users

    Parameters

    • Optional params: Omit<undefined | {
          after?: null | string;
          before?: null | string;
          include_users?: null | boolean;
          limit?: null | number;
          nearby?: null | string;
          sort?: null | "Relevance" | "Latest" | "Oldest";
      }, "include_users">

      Message fetching route data

    Returns Promise<{
        members: undefined | ServerMember[];
        messages: Message[];
        users: User[];
    }>

  • Check whether we have a given permission in a channel

    Returns

    Whether we have this permission

    Parameters

    • Rest ...permission: ("Masquerade" | "Video" | "ManageChannel" | "ManageServer" | "ManagePermissions" | "ManageRole" | "ManageCustomisation" | "KickMembers" | "BanMembers" | "TimeoutMembers" | "AssignRoles" | "ChangeNickname" | "ManageNicknames" | "ChangeAvatar" | "RemoveAvatars" | "ViewChannel" | "ReadMessageHistory" | "SendMessage" | "ManageMessages" | "ManageWebhooks" | "InviteOthers" | "SendEmbeds" | "UploadFiles" | "React" | "Connect" | "Speak" | "MuteMembers" | "DeafenMembers" | "MoveMembers" | "GrantAllSafe")[]

      Permission Names

    Returns boolean

  • Check whether we have at least one of the given permissions in a channel

    Returns

    Whether we have one of the permissions

    Parameters

    • Rest ...permission: ("Masquerade" | "Video" | "ManageChannel" | "ManageServer" | "ManagePermissions" | "ManageRole" | "ManageCustomisation" | "KickMembers" | "BanMembers" | "TimeoutMembers" | "AssignRoles" | "ChangeNickname" | "ManageNicknames" | "ChangeAvatar" | "RemoveAvatars" | "ViewChannel" | "ReadMessageHistory" | "SendMessage" | "ManageMessages" | "ManageWebhooks" | "InviteOthers" | "SendEmbeds" | "UploadFiles" | "React" | "Connect" | "Speak" | "MuteMembers" | "DeafenMembers" | "MoveMembers" | "GrantAllSafe")[]

      Permission Names

    Returns boolean

  • Remove a user from a group

    Requires

    Group

    Parameters

    • user_id: string

      ID of the target user

    Returns Promise<undefined>

  • Search for messages

    Requires

    SavedMessages, DirectMessage, Group, TextChannel

    Returns

    Messages

    Parameters

    • params: Omit<{
          after?: null | string;
          before?: null | string;
          include_users?: null | boolean;
          limit?: null | number;
          query: string;
          sort?: "Relevance" | "Latest" | "Oldest";
      }, "include_users">

      Message searching route data

    Returns Promise<Message[]>

  • Search for messages including the users that sent them

    Requires

    SavedMessages, DirectMessage, Group, TextChannel

    Returns

    Object including messages and users

    Parameters

    • params: Omit<{
          after?: null | string;
          before?: null | string;
          include_users?: null | boolean;
          limit?: null | number;
          query: string;
          sort?: "Relevance" | "Latest" | "Oldest";
      }, "include_users">

      Message searching route data

    Returns Promise<{
        members: undefined | ServerMember[];
        messages: Message[];
        users: User[];
    }>

  • Send a message

    Requires

    SavedMessages, DirectMessage, Group, TextChannel

    Returns

    Sent message

    Parameters

    • data: string | {
          attachments?: null | string[];
          content?: null | string;
          embeds?: null | {
              colour?: null | string;
              description?: null | string;
              icon_url?: null | string;
              media?: null | string;
              title?: null | string;
              url?: null | string;
          }[];
          interactions?: null | {
              reactions?: null | string[];
              restrict_reactions?: boolean;
          };
          masquerade?: null | {
              avatar?: null | string;
              colour?: null | string;
              name?: null | string;
          };
          nonce?: null | string;
          replies?: null | {
              id: string;
              mention: boolean;
          }[];
      }

      Either the message as a string or message sending route data

    • idempotencyKey: string = ...

    Returns Promise<Message>

  • Set role permissions

    Requires

    Group, TextChannel, VoiceChannel

    Parameters

    • role_id: string = "default"

      Role Id, set to 'default' to affect all users

    • permissions: {
          allow: number;
          deny: number;
      }

      Permission value

      • allow: number

        Format: uint64

        Description

        Allow bit flags

      • deny: number

        Format: uint64

        Description

        Disallow bit flags

    Returns Promise<{
        _id: string;
        analytics?: boolean;
        banner?: null | {
            _id: string;
            content_type: string;
            deleted?: null | boolean;
            filename: string;
            message_id?: null | string;
            metadata: {
                type: "File";
            } | {
                type: "Text";
            } | {
                height: number;
                type: "Image";
                width: number;
            } | {
                height: number;
                type: "Video";
                width: number;
            } | {
                type: "Audio";
            };
            object_id?: null | string;
            reported?: null | boolean;
            server_id?: null | string;
            size: number;
            tag: string;
            user_id?: null | string;
        };
        categories?: null | {
            channels: string[];
            id: string;
            title: string;
        }[];
        channels: string[];
        default_permissions: number;
        description?: null | string;
        discoverable?: boolean;
        flags?: null | number;
        icon?: null | {
            _id: string;
            content_type: string;
            deleted?: null | boolean;
            filename: string;
            message_id?: null | string;
            metadata: {
                type: "File";
            } | {
                type: "Text";
            } | {
                height: number;
                type: "Image";
                width: number;
            } | {
                height: number;
                type: "Video";
                width: number;
            } | {
                type: "Audio";
            };
            object_id?: null | string;
            reported?: null | boolean;
            server_id?: null | string;
            size: number;
            tag: string;
            user_id?: null | string;
        };
        name: string;
        nsfw?: boolean;
        owner: string;
        roles?: {
            [key: string]: components["schemas"]["Role"];
        };
        system_messages?: null | {
            user_banned?: null | string;
            user_joined?: null | string;
            user_kicked?: null | string;
            user_left?: null | string;
        };
    }>

  • Start typing in this channel

    Requires

    DirectMessage, Group, TextChannel

    Returns void

  • Stop typing in this channel

    Requires

    DirectMessage, Group, TextChannel

    Returns void

  • Write to string as a channel mention

    Returns

    Formatted String

    Returns string

Generated using TypeDoc

Class ChannelCollection

Collection of Channels

Hierarchy

Constructors

Properties

#objects: ReactiveMap<string, Channel> = ...
#storage: ObjectStorage<HydratedChannel> = ...
client: Client
getUnderlyingObject: ((id: string) => HydratedChannel)

Type declaration

    • (id: string): HydratedChannel
    • Parameters

      • id: string

      Returns HydratedChannel

updateUnderlyingObject: SetStoreFunction<Record<string, HydratedChannel>>

Methods

  • Create a new instance of an object

    Parameters

    • id: string

      Id

    • type: "channel" | "user" | "server" | "bot" | "channelUnread" | "emoji" | "message" | "serverMember"

      Type

    • instance: Channel

      Instance

    • context: unknown

      Context

    • Optional data: unknown

      Data

    Returns void

  • Get or create

    Parameters

    • id: string

      Id

    • data: {
          _id: string;
          channel_type: "SavedMessages";
          user: string;
      } | {
          _id: string;
          active: boolean;
          channel_type: "DirectMessage";
          last_message_id?: null | string;
          recipients: string[];
      } | {
          _id: string;
          channel_type: "Group";
          description?: null | string;
          icon?: null | {
              _id: string;
              content_type: string;
              deleted?: null | boolean;
              filename: string;
              message_id?: null | string;
              metadata: {
                  type: "File";
              } | {
                  type: "Text";
              } | {
                  height: number;
                  type: "Image";
                  width: number;
              } | {
                  height: number;
                  type: "Video";
                  width: number;
              } | {
                  type: "Audio";
              };
              object_id?: null | string;
              reported?: null | boolean;
              server_id?: null | string;
              size: number;
              tag: string;
              user_id?: null | string;
          };
          last_message_id?: null | string;
          name: string;
          nsfw?: boolean;
          owner: string;
          permissions?: null | number;
          recipients: string[];
      } | {
          _id: string;
          channel_type: "TextChannel";
          default_permissions?: null | {
              a: number;
              d: number;
          };
          description?: null | string;
          icon?: null | {
              _id: string;
              content_type: string;
              deleted?: null | boolean;
              filename: string;
              message_id?: null | string;
              metadata: {
                  type: "File";
              } | {
                  type: "Text";
              } | {
                  height: number;
                  type: "Image";
                  width: number;
              } | {
                  height: number;
                  type: "Video";
                  width: number;
              } | {
                  type: "Audio";
              };
              object_id?: null | string;
              reported?: null | boolean;
              server_id?: null | string;
              size: number;
              tag: string;
              user_id?: null | string;
          };
          last_message_id?: null | string;
          name: string;
          nsfw?: boolean;
          role_permissions?: {
              [key: string]: components["schemas"]["OverrideField"];
          };
          server: string;
      } | {
          _id: string;
          channel_type: "VoiceChannel";
          default_permissions?: null | {
              a: number;
              d: number;
          };
          description?: null | string;
          icon?: null | {
              _id: string;
              content_type: string;
              deleted?: null | boolean;
              filename: string;
              message_id?: null | string;
              metadata: {
                  type: "File";
              } | {
                  type: "Text";
              } | {
                  height: number;
                  type: "Image";
                  width: number;
              } | {
                  height: number;
                  type: "Video";
                  width: number;
              } | {
                  type: "Audio";
              };
              object_id?: null | string;
              reported?: null | boolean;
              server_id?: null | string;
              size: number;
              tag: string;
              user_id?: null | string;
          };
          name: string;
          nsfw?: boolean;
          role_permissions?: {
              [key: string]: components["schemas"]["OverrideField"];
          };
          server: string;
      }

      Data

    • isNew: boolean = false

      Whether this object is new

    Returns Channel

Generated using TypeDoc

Class ChannelEditSystemMessage

Channel Edit System Message

Hierarchy

Constructors

Properties

Accessors

Methods

Constructors

  • Construct System Message

    Parameters

    • client: Client

      Client

    • systemMessage: ({
          content: string;
          type: "text";
      } | {
          by: string;
          id: string;
          type: "user_added";
      } | {
          by: string;
          id: string;
          type: "user_remove";
      } | {
          id: string;
          type: "user_joined";
      } | {
          id: string;
          type: "user_left";
      } | {
          id: string;
          type: "user_kicked";
      } | {
          id: string;
          type: "user_banned";
      } | {
          by: string;
          name: string;
          type: "channel_renamed";
      } | {
          by: string;
          type: "channel_description_changed";
      } | {
          by: string;
          type: "channel_icon_changed";
      } | {
          from: string;
          to: string;
          type: "channel_ownership_changed";
      }) & {
          type: "channel_renamed" | "channel_description_changed" | "channel_icon_changed";
      }

      System Message

    Returns ChannelEditSystemMessage

Properties

byId: string
client?: Client
type: "text" | "user_added" | "user_remove" | "user_joined" | "user_left" | "user_kicked" | "user_banned" | "channel_renamed" | "channel_description_changed" | "channel_icon_changed" | "channel_ownership_changed"

Accessors

Methods

  • Create an System Message from an API System Message

    Returns

    System Message

    Parameters

    • client: Client

      Client

    • message: {
          content: string;
          type: "text";
      } | {
          by: string;
          id: string;
          type: "user_added";
      } | {
          by: string;
          id: string;
          type: "user_remove";
      } | {
          id: string;
          type: "user_joined";
      } | {
          id: string;
          type: "user_left";
      } | {
          id: string;
          type: "user_kicked";
      } | {
          id: string;
          type: "user_banned";
      } | {
          by: string;
          name: string;
          type: "channel_renamed";
      } | {
          by: string;
          type: "channel_description_changed";
      } | {
          by: string;
          type: "channel_icon_changed";
      } | {
          from: string;
          to: string;
          type: "channel_ownership_changed";
      }

    Returns SystemMessage

Generated using TypeDoc

Class ChannelInviteAbstract

Channel Invite

Hierarchy

Constructors

Properties

Methods

Constructors

Properties

client?: Client
type: "Server" | "None" | "Group"

Methods

  • Create an Invite from an API Invite

    Returns

    Invite

    Parameters

    • client: Client

      Client

    • invite: {
          _id: string;
          channel: string;
          creator: string;
          server: string;
          type: "Server";
      } | {
          _id: string;
          channel: string;
          creator: string;
          type: "Group";
      }

      Data

    Returns ChannelInvite

Generated using TypeDoc

Class ChannelOwnershipChangeSystemMessage

Channel Ownership Change System Message

Hierarchy

Constructors

Properties

Accessors

Methods

Constructors

Properties

client?: Client
fromId: string
toId: string
type: "text" | "user_added" | "user_remove" | "user_joined" | "user_left" | "user_kicked" | "user_banned" | "channel_renamed" | "channel_description_changed" | "channel_icon_changed" | "channel_ownership_changed"

Accessors

Methods

  • Create an System Message from an API System Message

    Returns

    System Message

    Parameters

    • client: Client

      Client

    • message: {
          content: string;
          type: "text";
      } | {
          by: string;
          id: string;
          type: "user_added";
      } | {
          by: string;
          id: string;
          type: "user_remove";
      } | {
          id: string;
          type: "user_joined";
      } | {
          id: string;
          type: "user_left";
      } | {
          id: string;
          type: "user_kicked";
      } | {
          id: string;
          type: "user_banned";
      } | {
          by: string;
          name: string;
          type: "channel_renamed";
      } | {
          by: string;
          type: "channel_description_changed";
      } | {
          by: string;
          type: "channel_icon_changed";
      } | {
          from: string;
          to: string;
          type: "channel_ownership_changed";
      }

    Returns SystemMessage

Generated using TypeDoc

Class ChannelRenamedSystemMessage

Channel Renamed System Message

Hierarchy

Constructors

Properties

Accessors

Methods

Constructors

Properties

byId: string
client?: Client
name: string
type: "text" | "user_added" | "user_remove" | "user_joined" | "user_left" | "user_kicked" | "user_banned" | "channel_renamed" | "channel_description_changed" | "channel_icon_changed" | "channel_ownership_changed"

Accessors

Methods

  • Create an System Message from an API System Message

    Returns

    System Message

    Parameters

    • client: Client

      Client

    • message: {
          content: string;
          type: "text";
      } | {
          by: string;
          id: string;
          type: "user_added";
      } | {
          by: string;
          id: string;
          type: "user_remove";
      } | {
          id: string;
          type: "user_joined";
      } | {
          id: string;
          type: "user_left";
      } | {
          id: string;
          type: "user_kicked";
      } | {
          id: string;
          type: "user_banned";
      } | {
          by: string;
          name: string;
          type: "channel_renamed";
      } | {
          by: string;
          type: "channel_description_changed";
      } | {
          by: string;
          type: "channel_icon_changed";
      } | {
          from: string;
          to: string;
          type: "channel_ownership_changed";
      }

    Returns SystemMessage

Generated using TypeDoc

Class ChannelUnread

Channel Unread Class

Hierarchy

  • ChannelUnread

Constructors

Properties

Accessors

Constructors

Properties

id: string

Accessors

  • get messageMentionIds(): ReactiveSet<string>
  • List of message IDs that we were mentioned in

    Returns ReactiveSet<string>

Generated using TypeDoc

Class ChannelUnreadCollection

Collection of Channel Unreads

Hierarchy

Constructors

Properties

#objects: ReactiveMap<string, ChannelUnread> = ...
#storage: ObjectStorage<HydratedChannelUnread> = ...
client: Client
getUnderlyingObject: ((id: string) => HydratedChannelUnread)

Type declaration

    • (id: string): HydratedChannelUnread
    • Parameters

      • id: string

      Returns HydratedChannelUnread

updateUnderlyingObject: SetStoreFunction<Record<string, HydratedChannelUnread>>

Methods

  • Create a new instance of an object

    Parameters

    • id: string

      Id

    • type: "channel" | "user" | "server" | "bot" | "channelUnread" | "emoji" | "message" | "serverMember"

      Type

    • instance: ChannelUnread

      Instance

    • context: unknown

      Context

    • Optional data: unknown

      Data

    Returns void

  • Get or create

    Parameters

    • id: string

      Id

    • data: {
          _id: {
              channel: string;
              user: string;
          };
          last_id?: null | string;
          mentions?: null | string[];
      }

      Data

      • _id: {
            channel: string;
            user: string;
        }

        Description

        Composite key pointing to a user's view of a channel

        • channel: string

          Description

          Channel Id

        • user: string

          Description

          User Id

      • Optional last_id?: null | string

        Description

        Id of the last message read in this channel by a user

      • Optional mentions?: null | string[]

        Description

        Array of message ids that mention the user

    Returns ChannelUnread

Generated using TypeDoc

Class ClassCollection<T, V>

Generic class collection backed by store

Type Parameters

  • T

  • V

Hierarchy

Constructors

Properties

#objects: ReactiveMap<string, T> = ...
#storage: ObjectStorage<V> = ...
client: Client
getUnderlyingObject: ((id: string) => V)

Type declaration

    • (id: string): V
    • Parameters

      • id: string

      Returns V

updateUnderlyingObject: SetStoreFunction<Record<string, V>>

Methods

  • Create a new instance of an object

    Parameters

    • id: string

      Id

    • type: "channel" | "user" | "server" | "bot" | "channelUnread" | "emoji" | "message" | "serverMember"

      Type

    • instance: T

      Instance

    • context: unknown

      Context

    • Optional data: unknown

      Data

    Returns void

  • Filter the collection by a given predicate

    Parameters

    • predicate: ((value: T, key: string) => boolean)

      Predicate to satisfy

        • (value: T, key: string): boolean
        • Parameters

          • value: T
          • key: string

          Returns boolean

    Returns T[]

  • Find some value based on a predicate

    Parameters

    • predicate: ((value: T, key: string) => boolean)

      Predicate to satisfy

        • (value: T, key: string): boolean
        • Parameters

          • value: T
          • key: string

          Returns boolean

    Returns undefined | T

  • Execute a provided function over each key, value pair in the map

    Returns

    Iterable

    Parameters

    • cb: ((value: T, key: string, map: ReactiveMap<string, T>) => void)

      Callback for each pair

        • (value: T, key: string, map: ReactiveMap<string, T>): void
        • Parameters

          • value: T
          • key: string
          • map: ReactiveMap<string, T>

          Returns void

    Returns void

  • Map the collection using a given callback

    Type Parameters

    • O

    Parameters

    • cb: ((value: T, key: string) => O)

      Callback

        • (value: T, key: string): O
        • Parameters

          • value: T
          • key: string

          Returns O

    Returns O[]

Generated using TypeDoc

Class Client

Revolt.js Clients

Hierarchy

  • EventEmitter<Events>
    • Client

Constructors

  • Create Revolt.js Client

    Parameters

    • Optional options: Partial<ClientOptions>
    • Optional configuration: {
          app: string;
          build: {
              commit_sha: string;
              commit_timestamp: string;
              origin_url: string;
              semver: string;
              timestamp: string;
          };
          features: {
              autumn: {
                  enabled: boolean;
                  url: string;
              };
              captcha: {
                  enabled: boolean;
                  key: string;
              };
              email: boolean;
              invite_only: boolean;
              january: {
                  enabled: boolean;
                  url: string;
              };
              voso: {
                  enabled: boolean;
                  url: string;
                  ws: string;
              };
          };
          revolt: string;
          vapid: string;
          ws: string;
      }
      • app: string

        Description

        URL pointing to the client serving this node

      • build: {
            commit_sha: string;
            commit_timestamp: string;
            origin_url: string;
            semver: string;
            timestamp: string;
        }

        Description

        Build information

        • commit_sha: string

          Description

          Commit Hash

        • commit_timestamp: string

          Description

          Commit Timestamp

        • origin_url: string

          Description

          Git Origin URL

        • semver: string

          Description

          Git Semver

        • timestamp: string

          Description

          Build Timestamp

      • features: {
            autumn: {
                enabled: boolean;
                url: string;
            };
            captcha: {
                enabled: boolean;
                key: string;
            };
            email: boolean;
            invite_only: boolean;
            january: {
                enabled: boolean;
                url: string;
            };
            voso: {
                enabled: boolean;
                url: string;
                ws: string;
            };
        }

        Description

        Features enabled on this Revolt node

        • autumn: {
              enabled: boolean;
              url: string;
          }

          Description

          File server service configuration

          • enabled: boolean

            Description

            Whether the service is enabled

          • url: string

            Description

            URL pointing to the service

        • captcha: {
              enabled: boolean;
              key: string;
          }

          Description

          hCaptcha configuration

          • enabled: boolean

            Description

            Whether captcha is enabled

          • key: string

            Description

            Client key used for solving captcha

        • email: boolean

          Description

          Whether email verification is enabled

        • invite_only: boolean

          Description

          Whether this server is invite only

        • january: {
              enabled: boolean;
              url: string;
          }

          Description

          Proxy service configuration

          • enabled: boolean

            Description

            Whether the service is enabled

          • url: string

            Description

            URL pointing to the service

        • voso: {
              enabled: boolean;
              url: string;
              ws: string;
          }

          Description

          Voice server configuration

          • enabled: boolean

            Description

            Whether voice is enabled

          • url: string

            Description

            URL pointing to the voice API

          • ws: string

            Description

            URL pointing to the voice WebSocket server

      • revolt: string

        Description

        Revolt API Version

      • vapid: string

        Description

        Web Push VAPID public key

      • ws: string

        Description

        WebSocket URL

    Returns Client

Properties

#reconnectTimeout: undefined | number
#session: undefined | Session
#setConnectionFailureCount: Setter<number>
#setReady: Setter<boolean>
api: API
channelUnreads: ChannelUnreadCollection
configuration: undefined | {
    app: string;
    build: {
        commit_sha: string;
        commit_timestamp: string;
        origin_url: string;
        semver: string;
        timestamp: string;
    };
    features: {
        autumn: {
            enabled: boolean;
            url: string;
        };
        captcha: {
            enabled: boolean;
            key: string;
        };
        email: boolean;
        invite_only: boolean;
        january: {
            enabled: boolean;
            url: string;
        };
        voso: {
            enabled: boolean;
            url: string;
            ws: string;
        };
    };
    revolt: string;
    vapid: string;
    ws: string;
}
connectionFailureCount: Accessor<number>
events: EventClient<1>
options: ClientOptions
ready: Accessor<boolean>
serverMembers: ServerMemberCollection
user: undefined | User
prefixed: string | boolean

Methods

  • Fetches the configuration of the server if it has not been already fetched.

    Returns Promise<void>

  • Update API object to use authentication.

    Returns void

  • Type Parameters

    • T extends keyof Events

    Parameters

    • event: T
    • fn: ((...args: ArgumentMap<Events>[Extract<T, keyof Events>]) => void)
        • (...args: ArgumentMap<Events>[Extract<T, keyof Events>]): void
        • Parameters

          • Rest ...args: ArgumentMap<Events>[Extract<T, keyof Events>]

          Returns void

    • Optional context: any

    Returns Client

  • Calls each of the listeners registered for a given event.

    Type Parameters

    • T extends keyof Events

    Parameters

    • event: T
    • Rest ...args: ArgumentMap<Events>[Extract<T, keyof Events>]

    Returns boolean

  • Return an array listing the events for which the emitter has registered listeners.

    Returns (keyof Events)[]

  • Return the number of listeners listening to a given event.

    Parameters

    • event: keyof Events

    Returns number

  • Return the listeners registered for a given event.

    Type Parameters

    • T extends keyof Events

    Parameters

    • event: T

    Returns ((...args: ArgumentMap<Events>[Extract<T, keyof Events>]) => void)[]

  • Log in with auth data, creating a new session in the process.

    Returns

    An on-boarding function if on-boarding is required, undefined otherwise

    Parameters

    • details: {
          email: string;
          friendly_name?: null | string;
          password: string;
      } | {
          friendly_name?: null | string;
          mfa_response?: null | {
              password: string;
          } | {
              recovery_code: string;
          } | {
              totp_code: string;
          };
          mfa_ticket: string;
      }

      Login data object

    Returns Promise<void>

  • Log in as a bot

    Parameters

    • token: string

      Bot token

    Returns Promise<void>

  • Prepare a markdown-based message to be displayed to the user as plain text.

    Returns

    Modified plain text

    Parameters

    • source: string

      Source markdown text

    Returns string

  • Type Parameters

    • T extends keyof Events

    Parameters

    • event: T
    • Optional fn: ((...args: ArgumentMap<Events>[Extract<T, keyof Events>]) => void)
        • (...args: ArgumentMap<Events>[Extract<T, keyof Events>]): void
        • Parameters

          • Rest ...args: ArgumentMap<Events>[Extract<T, keyof Events>]

          Returns void

    • Optional context: any
    • Optional once: boolean

    Returns Client

  • Add a listener for a given event.

    Type Parameters

    • T extends keyof Events

    Parameters

    • event: T
    • fn: ((...args: ArgumentMap<Events>[Extract<T, keyof Events>]) => void)
        • (...args: ArgumentMap<Events>[Extract<T, keyof Events>]): void
        • Parameters

          • Rest ...args: ArgumentMap<Events>[Extract<T, keyof Events>]

          Returns void

    • Optional context: any

    Returns Client

  • Add a one-time listener for a given event.

    Type Parameters

    • T extends keyof Events

    Parameters

    • event: T
    • fn: ((...args: ArgumentMap<Events>[Extract<T, keyof Events>]) => void)
        • (...args: ArgumentMap<Events>[Extract<T, keyof Events>]): void
        • Parameters

          • Rest ...args: ArgumentMap<Events>[Extract<T, keyof Events>]

          Returns void

    • Optional context: any

    Returns Client

  • Proxy a file through January.

    Returns

    Proxied media URL

    Parameters

    • url: string

      URL to proxy

    Returns undefined | string

  • Register for a new account

    Returns

    A promise containing a registration response object

    Parameters

    • data: {
          captcha?: null | string;
          email: string;
          invite?: null | string;
          password: string;
      }

      Registration data object

      • Optional captcha?: null | string

        Description

        Captcha verification code

      • email: string

        Description

        Valid email address

      • Optional invite?: null | string

        Description

        Invite code

      • password: string

        Description

        Password

    Returns Promise<undefined>

  • Remove all listeners, or those of the specified event.

    Parameters

    • Optional event: keyof Events

    Returns Client

  • Remove the listeners of a given event.

    Type Parameters

    • T extends keyof Events

    Parameters

    • event: T
    • Optional fn: ((...args: ArgumentMap<Events>[Extract<T, keyof Events>]) => void)
        • (...args: ArgumentMap<Events>[Extract<T, keyof Events>]): void
        • Parameters

          • Rest ...args: ArgumentMap<Events>[Extract<T, keyof Events>]

          Returns void

    • Optional context: any
    • Optional once: boolean

    Returns Client

  • Use an existing session to log into Revolt

    Returns

    An on-boarding function if on-boarding is required, undefined otherwise

    Parameters

    • session: Session

      Session data object

    Returns Promise<void>

Generated using TypeDoc

Class Collection<T>Abstract

Abstract Collection type

Type Parameters

  • T

Hierarchy

Constructors

Methods

  • Iterable of key, value pairs in the map

    Returns

    Iterable

    Returns IterableIterator<[string, T]>

  • Filter the collection by a given predicate

    Parameters

    • predicate: ((value: T, key: string) => boolean)

      Predicate to satisfy

        • (value: T, key: string): boolean
        • Parameters

          • value: T
          • key: string

          Returns boolean

    Returns T[]

  • Find some value based on a predicate

    Parameters

    • predicate: ((value: T, key: string) => boolean)

      Predicate to satisfy

        • (value: T, key: string): boolean
        • Parameters

          • value: T
          • key: string

          Returns boolean

    Returns undefined | T

  • Execute a provided function over each key, value pair in the map

    Parameters

    • cb: ((value: T, key: string, map: ReactiveMap<string, T>) => void)

      Callback for each pair

        • (value: T, key: string, map: ReactiveMap<string, T>): void
        • Parameters

          • value: T
          • key: string
          • map: ReactiveMap<string, T>

          Returns void

    Returns void

  • Check whether an id exists in the Collection

    Returns

    Whether it exists

    Parameters

    • id: string

      Id

    Returns boolean

  • Map the collection using a given callback

    Type Parameters

    • O

    Parameters

    • cb: ((value: T, key: string) => O)

      Callback

        • (value: T, key: string): O
        • Parameters

          • value: T
          • key: string

          Returns O

    Returns O[]

Generated using TypeDoc

Class Emoji

Emoji Class

Hierarchy

  • Emoji

Constructors

Properties

Accessors

Methods

Constructors

Properties

#collection: EmojiCollection
id: string

Accessors

  • get parent(): {
        id: string;
        type: "Server";
    } | {
        type: "Detached";
    }
  • Information about the parent of this emoji

    Returns {
        id: string;
        type: "Server";
    } | {
        type: "Detached";
    }

Methods

Generated using TypeDoc

Class EmojiCollection

Collection of Emoji

Hierarchy

Constructors

Properties

#objects: ReactiveMap<string, Emoji> = ...
#storage: ObjectStorage<HydratedEmoji> = ...
client: Client
getUnderlyingObject: ((id: string) => HydratedEmoji)

Type declaration

    • (id: string): HydratedEmoji
    • Parameters

      • id: string

      Returns HydratedEmoji

updateUnderlyingObject: SetStoreFunction<Record<string, HydratedEmoji>>

Methods

  • Create a new instance of an object

    Parameters

    • id: string

      Id

    • type: "channel" | "user" | "server" | "bot" | "channelUnread" | "emoji" | "message" | "serverMember"

      Type

    • instance: Emoji

      Instance

    • context: unknown

      Context

    • Optional data: unknown

      Data

    Returns void

  • Execute a provided function over each key, value pair in the map

    Returns

    Iterable

    Parameters

    • cb: ((value: Emoji, key: string, map: ReactiveMap<string, Emoji>) => void)

      Callback for each pair

        • (value: Emoji, key: string, map: ReactiveMap<string, Emoji>): void
        • Parameters

          • value: Emoji
          • key: string
          • map: ReactiveMap<string, Emoji>

          Returns void

    Returns void

  • Get or create

    Parameters

    • id: string

      Id

    • data: {
          _id: string;
          animated?: boolean;
          creator_id: string;
          name: string;
          nsfw?: boolean;
          parent: {
              id: string;
              type: "Server";
          } | {
              type: "Detached";
          };
      }

      Data

      • _id: string

        Description

        Unique Id

      • Optional animated?: boolean

        Description

        Whether the emoji is animated

      • creator_id: string

        Description

        Uploader user id

      • name: string

        Description

        Emoji name

      • Optional nsfw?: boolean

        Description

        Whether the emoji is marked as nsfw

      • parent: {
            id: string;
            type: "Server";
        } | {
            type: "Detached";
        }

        Description

        What owns this emoji

    • isNew: boolean = false

      Whether this object is new

    Returns Emoji

Generated using TypeDoc

Class EventClient<T>

Simple wrapper around the Revolt websocket service.

Type Parameters

  • T extends AvailableProtocols

Hierarchy

  • EventEmitter<Events<T, EventProtocol<T>>>
    • EventClient

Constructors

  • Create a new event client.

    Type Parameters

    • T extends 1

    Parameters

    • protocolVersion: T

      Target protocol version

    • transportFormat: "json" = "json"

      Communication format

    • Optional options: Partial<EventClientOptions>

      Configuration options

    Returns EventClient<T>

Properties

#heartbeatIntervalReference: undefined | number
#pongTimeoutReference: undefined | number
#protocolVersion: T
#setPing: Setter<number>
#setStateSetter: Setter<ConnectionState>
#socket: undefined | WebSocket
#transportFormat: "json" | "msgpack"
options: EventClientOptions
ping: Accessor<number>
state: Accessor<ConnectionState>
prefixed: string | boolean

Methods

  • Type Parameters

    • T extends keyof Events<T, EventProtocol<T>>

    Parameters

    • event: T
    • fn: ((...args: ArgumentMap<Events<T, EventProtocol<T>>>[Extract<T, keyof Events<T, EventProtocol<T>>>]) => void)
        • (...args: ArgumentMap<Events<T, EventProtocol<T>>>[Extract<T, keyof Events<T, EventProtocol<T>>>]): void
        • Parameters

          • Rest ...args: ArgumentMap<Events<T, EventProtocol<T>>>[Extract<T, keyof Events<T, EventProtocol<T>>>]

          Returns void

    • Optional context: any

    Returns EventClient<T>

  • Connect to the websocket service.

    Parameters

    • uri: string

      WebSocket URI

    • token: string

      Authentication token

    Returns void

  • Calls each of the listeners registered for a given event.

    Type Parameters

    • T extends keyof Events<T, EventProtocol<T>>

    Parameters

    • event: T
    • Rest ...args: ArgumentMap<Events<T, EventProtocol<T>>>[Extract<T, keyof Events<T, EventProtocol<T>>>]

    Returns boolean

  • Return an array listing the events for which the emitter has registered listeners.

    Returns (keyof Events<T, EventProtocol<T>>)[]

  • Handle events intended for client before passing them along.

    Parameters

    • event: EventProtocol<T>["server"]

      Event

    Returns void

  • Return the number of listeners listening to a given event.

    Parameters

    • event: keyof Events<T, EventProtocol<T>>

    Returns number

  • Return the listeners registered for a given event.

    Type Parameters

    • T extends keyof Events<T, EventProtocol<T>>

    Parameters

    • event: T

    Returns ((...args: ArgumentMap<Events<T, EventProtocol<T>>>[Extract<T, keyof Events<T, EventProtocol<T>>>]) => void)[]

  • Type Parameters

    • T extends keyof Events<T, EventProtocol<T>>

    Parameters

    • event: T
    • Optional fn: ((...args: ArgumentMap<Events<T, EventProtocol<T>>>[Extract<T, keyof Events<T, EventProtocol<T>>>]) => void)
        • (...args: ArgumentMap<Events<T, EventProtocol<T>>>[Extract<T, keyof Events<T, EventProtocol<T>>>]): void
        • Parameters

          • Rest ...args: ArgumentMap<Events<T, EventProtocol<T>>>[Extract<T, keyof Events<T, EventProtocol<T>>>]

          Returns void

    • Optional context: any
    • Optional once: boolean

    Returns EventClient<T>

  • Add a listener for a given event.

    Type Parameters

    • T extends keyof Events<T, EventProtocol<T>>

    Parameters

    • event: T
    • fn: ((...args: ArgumentMap<Events<T, EventProtocol<T>>>[Extract<T, keyof Events<T, EventProtocol<T>>>]) => void)
        • (...args: ArgumentMap<Events<T, EventProtocol<T>>>[Extract<T, keyof Events<T, EventProtocol<T>>>]): void
        • Parameters

          • Rest ...args: ArgumentMap<Events<T, EventProtocol<T>>>[Extract<T, keyof Events<T, EventProtocol<T>>>]

          Returns void

    • Optional context: any

    Returns EventClient<T>

  • Add a one-time listener for a given event.

    Type Parameters

    • T extends keyof Events<T, EventProtocol<T>>

    Parameters

    • event: T
    • fn: ((...args: ArgumentMap<Events<T, EventProtocol<T>>>[Extract<T, keyof Events<T, EventProtocol<T>>>]) => void)
        • (...args: ArgumentMap<Events<T, EventProtocol<T>>>[Extract<T, keyof Events<T, EventProtocol<T>>>]): void
        • Parameters

          • Rest ...args: ArgumentMap<Events<T, EventProtocol<T>>>[Extract<T, keyof Events<T, EventProtocol<T>>>]

          Returns void

    • Optional context: any

    Returns EventClient<T>

  • Remove all listeners, or those of the specified event.

    Parameters

    • Optional event: keyof Events<T, EventProtocol<T>>

    Returns EventClient<T>

  • Remove the listeners of a given event.

    Type Parameters

    • T extends keyof Events<T, EventProtocol<T>>

    Parameters

    • event: T
    • Optional fn: ((...args: ArgumentMap<Events<T, EventProtocol<T>>>[Extract<T, keyof Events<T, EventProtocol<T>>>]) => void)
        • (...args: ArgumentMap<Events<T, EventProtocol<T>>>[Extract<T, keyof Events<T, EventProtocol<T>>>]): void
        • Parameters

          • Rest ...args: ArgumentMap<Events<T, EventProtocol<T>>>[Extract<T, keyof Events<T, EventProtocol<T>>>]

          Returns void

    • Optional context: any
    • Optional once: boolean

    Returns EventClient<T>

  • Send an event to the server.

    Parameters

    • event: EventProtocol<T>["client"]

      Event

    Returns void

Generated using TypeDoc

Class File

Uploaded File

Hierarchy

  • File

Constructors

  • Construct File

    Parameters

    • client: Client

      Client

    • file: {
          _id: string;
          content_type: string;
          deleted?: null | boolean;
          filename: string;
          message_id?: null | string;
          metadata: {
              type: "File";
          } | {
              type: "Text";
          } | {
              height: number;
              type: "Image";
              width: number;
          } | {
              height: number;
              type: "Video";
              width: number;
          } | {
              type: "Audio";
          };
          object_id?: null | string;
          reported?: null | boolean;
          server_id?: null | string;
          size: number;
          tag: string;
          user_id?: null | string;
      }

      File

      • _id: string

        Description

        Unique Id

      • content_type: string

        Description

        Raw content type of this file

      • Optional deleted?: null | boolean

        Description

        Whether this file was deleted

      • filename: string

        Description

        Original filename

      • Optional message_id?: null | string
      • metadata: {
            type: "File";
        } | {
            type: "Text";
        } | {
            height: number;
            type: "Image";
            width: number;
        } | {
            height: number;
            type: "Video";
            width: number;
        } | {
            type: "Audio";
        }

        Description

        Parsed metadata of this file

      • Optional object_id?: null | string

        Description

        Id of the object this file is associated with

      • Optional reported?: null | boolean

        Description

        Whether this file was reported

      • Optional server_id?: null | string
      • size: number

        Format: int

        Description

        Size of this file (in bytes)

      • tag: string

        Description

        Tag / bucket this file was uploaded to

      • Optional user_id?: null | string

    Returns File

Properties

#client: Client
contentType: string

Raw content type of this file

filename: string

Original filename

id: string

File Id

metadata: {
    type: "File";
} | {
    type: "Text";
} | {
    height: number;
    type: "Image";
    width: number;
} | {
    height: number;
    type: "Video";
    width: number;
} | {
    type: "Audio";
}

Parsed metadata of the file

size: number

Size of the file (in bytes)

tag: string

File bucket

Accessors

  • get isSpoiler(): boolean
  • Whether this file should have a spoiler

    Returns boolean

Methods

  • Creates a URL to a given file with given options.

    Returns

    Generated URL or nothing

    Parameters

    • Optional options: {
          height?: number;
          max_side?: number;
          size?: number;
          width?: number;
      }

      Optional query parameters to modify object

      • Optional height?: number
      • Optional max_side?: number
      • Optional size?: number
      • Optional width?: number
    • Optional allowAnimation: boolean

      Returns GIF if applicable, no operations occur on image

    Returns undefined | string

Generated using TypeDoc

Class ImageEmbed

Image Embed

Hierarchy

Constructors

Properties

Accessors

Methods

Constructors

Properties

client?: Client
height: number
size: "Large" | "Preview"
type: "None" | "Website" | "Image" | "Video" | "Text"
url: string
width: number

Accessors

Methods

  • Create an Embed from an API Embed

    Returns

    Embed

    Parameters

    • client: Client

      Client

    • embed: {
          colour?: null | string;
          description?: null | string;
          icon_url?: null | string;
          image?: null | {
              height: number;
              size: "Large" | "Preview";
              url: string;
              width: number;
          };
          original_url?: null | string;
          site_name?: null | string;
          special?: null | {
              type: "None";
          } | {
              type: "GIF";
          } | {
              id: string;
              timestamp?: null | string;
              type: "YouTube";
          } | {
              content_type: "Channel";
              id: string;
              type: "Lightspeed";
          } | {
              content_type: "Channel" | "Video" | "Clip";
              id: string;
              type: "Twitch";
          } | {
              content_type: string;
              id: string;
              type: "Spotify";
          } | {
              type: "Soundcloud";
          } | {
              content_type: "Album" | "Track";
              id: string;
              type: "Bandcamp";
          } | {
              id: string;
              type: "Streamable";
          };
          title?: null | string;
          type: "Website";
          url?: null | string;
          video?: null | {
              height: number;
              url: string;
              width: number;
          };
      } | {
          height: number;
          size: "Large" | "Preview";
          type: "Image";
          url: string;
          width: number;
      } | {
          height: number;
          type: "Video";
          url: string;
          width: number;
      } | {
          colour?: null | string;
          description?: null | string;
          icon_url?: null | string;
          media?: null | {
              _id: string;
              content_type: string;
              deleted?: null | boolean;
              filename: string;
              message_id?: null | string;
              metadata: {
                  type: "File";
              } | {
                  type: "Text";
              } | {
                  height: number;
                  type: "Image";
                  width: number;
              } | {
                  height: number;
                  type: "Video";
                  width: number;
              } | {
                  type: "Audio";
              };
              object_id?: null | string;
              reported?: null | boolean;
              server_id?: null | string;
              size: number;
              tag: string;
              user_id?: null | string;
          };
          title?: null | string;
          type: "Text";
          url?: null | string;
      } | {
          type: "None";
      }

      Data

    Returns MessageEmbed

Generated using TypeDoc

Class Message

Message Class

Hierarchy

  • Message

Constructors

Properties

#collection: MessageCollection
id: string

Accessors

  • get animatedAvatarURL(): undefined | string
  • Get the animated avatar URL for this message

    Returns undefined | string

  • get authorId(): undefined | string
  • Id of user this message was sent by

    Returns undefined | string

  • get avatarURL(): undefined | string
  • Get the avatar URL for this message

    Returns undefined | string

  • get editedAt(): undefined | Date
  • Time at which this message was edited

    Returns undefined | Date

  • get interactions(): undefined | {
        reactions?: null | string[];
        restrict_reactions?: boolean;
    }
  • Interactions

    Returns undefined | {
        reactions?: null | string[];
        restrict_reactions?: boolean;
    }

  • get masquerade(): undefined | {
        avatar?: null | string;
        colour?: null | string;
        name?: null | string;
    }
  • Masquerade

    Returns undefined | {
        avatar?: null | string;
        colour?: null | string;
        name?: null | string;
    }

  • get masqueradeAvatarURL(): undefined | string
  • Avatar URL from the masquerade

    Returns undefined | string

  • get mentionIds(): undefined | string[]
  • IDs of users this message mentions

    Returns undefined | string[]

  • get reactions(): ReactiveMap<string, ReactiveSet<string>>
  • Reactions

    Returns ReactiveMap<string, ReactiveSet<string>>

  • get replyIds(): undefined | string[]
  • IDs of messages this message replies to

    Returns undefined | string[]

  • get roleColour(): undefined | null | string
  • Get the role colour for this message

    Returns undefined | null | string

  • get username(): undefined | string
  • Get the username for this message

    Returns undefined | string

Methods

  • Clear all reactions from this message

    Returns Promise<undefined>

  • Edit a message

    Parameters

    • data: {
          content?: null | string;
          embeds?: null | {
              colour?: null | string;
              description?: null | string;
              icon_url?: null | string;
              media?: null | string;
              title?: null | string;
              url?: null | string;
          }[];
      }

      Message edit route data

      • Optional content?: null | string

        Description

        New message content

      • Optional embeds?: null | {
            colour?: null | string;
            description?: null | string;
            icon_url?: null | string;
            media?: null | string;
            title?: null | string;
            url?: null | string;
        }[]

        Description

        Embeds to include in the message

    Returns Promise<{
        _id: string;
        attachments?: null | {
            _id: string;
            content_type: string;
            deleted?: null | boolean;
            filename: string;
            message_id?: null | string;
            metadata: {
                type: "File";
            } | {
                type: "Text";
            } | {
                height: number;
                type: "Image";
                width: number;
            } | {
                height: number;
                type: "Video";
                width: number;
            } | {
                type: "Audio";
            };
            object_id?: null | string;
            reported?: null | boolean;
            server_id?: null | string;
            size: number;
            tag: string;
            user_id?: null | string;
        }[];
        author: string;
        channel: string;
        content?: null | string;
        edited?: null | string;
        embeds?: null | ({
            colour?: null | string;
            description?: null | string;
            icon_url?: null | string;
            image?: null | {
                height: number;
                size: "Large" | "Preview";
                url: string;
                width: number;
            };
            original_url?: null | string;
            site_name?: null | string;
            special?: null | {
                type: "None";
            } | {
                type: "GIF";
            } | {
                id: string;
                timestamp?: null | string;
                type: "YouTube";
            } | {
                content_type: "Channel";
                id: string;
                type: "Lightspeed";
            } | {
                content_type: "Channel" | "Video" | "Clip";
                id: string;
                type: "Twitch";
            } | {
                content_type: string;
                id: string;
                type: "Spotify";
            } | {
                type: "Soundcloud";
            } | {
                content_type: "Album" | "Track";
                id: string;
                type: "Bandcamp";
            } | {
                id: string;
                type: "Streamable";
            };
            title?: null | string;
            type: "Website";
            url?: null | string;
            video?: null | {
                height: number;
                url: string;
                width: number;
            };
        } | {
            height: number;
            size: "Large" | "Preview";
            type: "Image";
            url: string;
            width: number;
        } | {
            height: number;
            type: "Video";
            url: string;
            width: number;
        } | {
            colour?: null | string;
            description?: null | string;
            icon_url?: null | string;
            media?: null | {
                _id: string;
                content_type: string;
                deleted?: null | boolean;
                filename: string;
                message_id?: null | string;
                metadata: {
                    type: "File";
                } | {
                    type: "Text";
                } | {
                    height: number;
                    type: "Image";
                    width: number;
                } | {
                    height: number;
                    type: "Video";
                    width: number;
                } | {
                    type: "Audio";
                };
                object_id?: null | string;
                reported?: null | boolean;
                server_id?: null | string;
                size: number;
                tag: string;
                user_id?: null | string;
            };
            title?: null | string;
            type: "Text";
            url?: null | string;
        } | {
            type: "None";
        })[];
        interactions?: {
            reactions?: null | string[];
            restrict_reactions?: boolean;
        };
        masquerade?: null | {
            avatar?: null | string;
            colour?: null | string;
            name?: null | string;
        };
        mentions?: null | string[];
        nonce?: null | string;
        reactions?: {
            [key: string]: string[];
        };
        replies?: null | string[];
        system?: null | {
            content: string;
            type: "text";
        } | {
            by: string;
            id: string;
            type: "user_added";
        } | {
            by: string;
            id: string;
            type: "user_remove";
        } | {
            id: string;
            type: "user_joined";
        } | {
            id: string;
            type: "user_left";
        } | {
            id: string;
            type: "user_kicked";
        } | {
            id: string;
            type: "user_banned";
        } | {
            by: string;
            name: string;
            type: "channel_renamed";
        } | {
            by: string;
            type: "channel_description_changed";
        } | {
            by: string;
            type: "channel_icon_changed";
        } | {
            from: string;
            to: string;
            type: "channel_ownership_changed";
        };
    }>

  • React to a message

    Parameters

    • emoji: string

      Unicode or emoji ID

    Returns Promise<undefined>

  • Reply to Message

    Parameters

    • data: string | Omit<{
          attachments?: null | string[];
          content?: null | string;
          embeds?: null | {
              colour?: null | string;
              description?: null | string;
              icon_url?: null | string;
              media?: null | string;
              title?: null | string;
              url?: null | string;
          }[];
          interactions?: null | {
              reactions?: null | string[];
              restrict_reactions?: boolean;
          };
          masquerade?: null | {
              avatar?: null | string;
              colour?: null | string;
              name?: null | string;
          };
          nonce?: null | string;
          replies?: null | {
              id: string;
              mention: boolean;
          }[];
      }, "nonce"> & {
          nonce?: string;
      }
    • mention: boolean = true

    Returns undefined | Promise<Message>

  • Un-react from a message

    Parameters

    • emoji: string

      Unicode or emoji ID

    Returns Promise<undefined>

Generated using TypeDoc

Class MessageCollection

Collection of Messages

Hierarchy

Constructors

Properties

#objects: ReactiveMap<string, Message> = ...
#storage: ObjectStorage<HydratedMessage> = ...
client: Client
getUnderlyingObject: ((id: string) => HydratedMessage)

Type declaration

    • (id: string): HydratedMessage
    • Parameters

      • id: string

      Returns HydratedMessage

updateUnderlyingObject: SetStoreFunction<Record<string, HydratedMessage>>

Methods

  • Create a new instance of an object

    Parameters

    • id: string

      Id

    • type: "channel" | "user" | "server" | "bot" | "channelUnread" | "emoji" | "message" | "serverMember"

      Type

    • instance: Message

      Instance

    • context: unknown

      Context

    • Optional data: unknown

      Data

    Returns void

  • Get or create

    Parameters

    • id: string

      Id

    • data: {
          _id: string;
          attachments?: null | {
              _id: string;
              content_type: string;
              deleted?: null | boolean;
              filename: string;
              message_id?: null | string;
              metadata: {
                  type: "File";
              } | {
                  type: "Text";
              } | {
                  height: number;
                  type: "Image";
                  width: number;
              } | {
                  height: number;
                  type: "Video";
                  width: number;
              } | {
                  type: "Audio";
              };
              object_id?: null | string;
              reported?: null | boolean;
              server_id?: null | string;
              size: number;
              tag: string;
              user_id?: null | string;
          }[];
          author: string;
          channel: string;
          content?: null | string;
          edited?: null | string;
          embeds?: null | ({
              colour?: null | string;
              description?: null | string;
              icon_url?: null | string;
              image?: null | {
                  height: number;
                  size: "Large" | "Preview";
                  url: string;
                  width: number;
              };
              original_url?: null | string;
              site_name?: null | string;
              special?: null | {
                  type: "None";
              } | {
                  type: "GIF";
              } | {
                  id: string;
                  timestamp?: null | string;
                  type: "YouTube";
              } | {
                  content_type: "Channel";
                  id: string;
                  type: "Lightspeed";
              } | {
                  content_type: "Channel" | "Video" | "Clip";
                  id: string;
                  type: "Twitch";
              } | {
                  content_type: string;
                  id: string;
                  type: "Spotify";
              } | {
                  type: "Soundcloud";
              } | {
                  content_type: "Album" | "Track";
                  id: string;
                  type: "Bandcamp";
              } | {
                  id: string;
                  type: "Streamable";
              };
              title?: null | string;
              type: "Website";
              url?: null | string;
              video?: null | {
                  height: number;
                  url: string;
                  width: number;
              };
          } | {
              height: number;
              size: "Large" | "Preview";
              type: "Image";
              url: string;
              width: number;
          } | {
              height: number;
              type: "Video";
              url: string;
              width: number;
          } | {
              colour?: null | string;
              description?: null | string;
              icon_url?: null | string;
              media?: null | {
                  _id: string;
                  content_type: string;
                  deleted?: null | boolean;
                  filename: string;
                  message_id?: null | string;
                  metadata: {
                      type: "File";
                  } | {
                      type: "Text";
                  } | {
                      height: number;
                      type: "Image";
                      width: number;
                  } | {
                      height: number;
                      type: "Video";
                      width: number;
                  } | {
                      type: "Audio";
                  };
                  object_id?: null | string;
                  reported?: null | boolean;
                  server_id?: null | string;
                  size: number;
                  tag: string;
                  user_id?: null | string;
              };
              title?: null | string;
              type: "Text";
              url?: null | string;
          } | {
              type: "None";
          })[];
          interactions?: {
              reactions?: null | string[];
              restrict_reactions?: boolean;
          };
          masquerade?: null | {
              avatar?: null | string;
              colour?: null | string;
              name?: null | string;
          };
          mentions?: null | string[];
          nonce?: null | string;
          reactions?: {
              [key: string]: string[];
          };
          replies?: null | string[];
          system?: null | {
              content: string;
              type: "text";
          } | {
              by: string;
              id: string;
              type: "user_added";
          } | {
              by: string;
              id: string;
              type: "user_remove";
          } | {
              id: string;
              type: "user_joined";
          } | {
              id: string;
              type: "user_left";
          } | {
              id: string;
              type: "user_kicked";
          } | {
              id: string;
              type: "user_banned";
          } | {
              by: string;
              name: string;
              type: "channel_renamed";
          } | {
              by: string;
              type: "channel_description_changed";
          } | {
              by: string;
              type: "channel_icon_changed";
          } | {
              from: string;
              to: string;
              type: "channel_ownership_changed";
          };
      }

      Data

      • _id: string

        Description

        Unique Id

      • Optional attachments?: null | {
            _id: string;
            content_type: string;
            deleted?: null | boolean;
            filename: string;
            message_id?: null | string;
            metadata: {
                type: "File";
            } | {
                type: "Text";
            } | {
                height: number;
                type: "Image";
                width: number;
            } | {
                height: number;
                type: "Video";
                width: number;
            } | {
                type: "Audio";
            };
            object_id?: null | string;
            reported?: null | boolean;
            server_id?: null | string;
            size: number;
            tag: string;
            user_id?: null | string;
        }[]

        Description

        Array of attachments

      • author: string

        Description

        Id of the user that sent this message

      • channel: string

        Description

        Id of the channel this message was sent in

      • Optional content?: null | string

        Description

        Message content

      • Optional edited?: null | string

        Description

        Time at which this message was last edited

      • Optional embeds?: null | ({
            colour?: null | string;
            description?: null | string;
            icon_url?: null | string;
            image?: null | {
                height: number;
                size: "Large" | "Preview";
                url: string;
                width: number;
            };
            original_url?: null | string;
            site_name?: null | string;
            special?: null | {
                type: "None";
            } | {
                type: "GIF";
            } | {
                id: string;
                timestamp?: null | string;
                type: "YouTube";
            } | {
                content_type: "Channel";
                id: string;
                type: "Lightspeed";
            } | {
                content_type: "Channel" | "Video" | "Clip";
                id: string;
                type: "Twitch";
            } | {
                content_type: string;
                id: string;
                type: "Spotify";
            } | {
                type: "Soundcloud";
            } | {
                content_type: "Album" | "Track";
                id: string;
                type: "Bandcamp";
            } | {
                id: string;
                type: "Streamable";
            };
            title?: null | string;
            type: "Website";
            url?: null | string;
            video?: null | {
                height: number;
                url: string;
                width: number;
            };
        } | {
            height: number;
            size: "Large" | "Preview";
            type: "Image";
            url: string;
            width: number;
        } | {
            height: number;
            type: "Video";
            url: string;
            width: number;
        } | {
            colour?: null | string;
            description?: null | string;
            icon_url?: null | string;
            media?: null | {
                _id: string;
                content_type: string;
                deleted?: null | boolean;
                filename: string;
                message_id?: null | string;
                metadata: {
                    type: "File";
                } | {
                    type: "Text";
                } | {
                    height: number;
                    type: "Image";
                    width: number;
                } | {
                    height: number;
                    type: "Video";
                    width: number;
                } | {
                    type: "Audio";
                };
                object_id?: null | string;
                reported?: null | boolean;
                server_id?: null | string;
                size: number;
                tag: string;
                user_id?: null | string;
            };
            title?: null | string;
            type: "Text";
            url?: null | string;
        } | {
            type: "None";
        })[]

        Description

        Attached embeds to this message

      • Optional interactions?: {
            reactions?: null | string[];
            restrict_reactions?: boolean;
        }

        Description

        Information about how this message should be interacted with

        • Optional reactions?: null | string[]

          Description

          Reactions which should always appear and be distinct

        • Optional restrict_reactions?: boolean

          Description

          Whether reactions should be restricted to the given list

          Can only be set to true if reactions list is of at least length 1

      • Optional masquerade?: null | {
            avatar?: null | string;
            colour?: null | string;
            name?: null | string;
        }

        Description

        Name and / or avatar overrides for this message

      • Optional mentions?: null | string[]

        Description

        Array of user ids mentioned in this message

      • Optional nonce?: null | string

        Description

        Unique value generated by client sending this message

      • Optional reactions?: {
            [key: string]: string[];
        }

        Description

        Hashmap of emoji IDs to array of user IDs

        • [key: string]: string[]
      • Optional replies?: null | string[]

        Description

        Array of message ids this message is replying to

      • Optional system?: null | {
            content: string;
            type: "text";
        } | {
            by: string;
            id: string;
            type: "user_added";
        } | {
            by: string;
            id: string;
            type: "user_remove";
        } | {
            id: string;
            type: "user_joined";
        } | {
            id: string;
            type: "user_left";
        } | {
            id: string;
            type: "user_kicked";
        } | {
            id: string;
            type: "user_banned";
        } | {
            by: string;
            name: string;
            type: "channel_renamed";
        } | {
            by: string;
            type: "channel_description_changed";
        } | {
            by: string;
            type: "channel_icon_changed";
        } | {
            from: string;
            to: string;
            type: "channel_ownership_changed";
        }

        Description

        System message

    • isNew: boolean = false

      Whether this object is new

    Returns Message

  • Globally fetch messages

    Requires

    Admin

    Parameters

    • query: Object

      Message query

    Returns Promise<{
        _id: string;
        attachments?: null | {
            _id: string;
            content_type: string;
            deleted?: null | boolean;
            filename: string;
            message_id?: null | string;
            metadata: {
                type: "File";
            } | {
                type: "Text";
            } | {
                height: number;
                type: "Image";
                width: number;
            } | {
                height: number;
                type: "Video";
                width: number;
            } | {
                type: "Audio";
            };
            object_id?: null | string;
            reported?: null | boolean;
            server_id?: null | string;
            size: number;
            tag: string;
            user_id?: null | string;
        }[];
        author: string;
        channel: string;
        content?: null | string;
        edited?: null | string;
        embeds?: null | ({
            colour?: null | string;
            description?: null | string;
            icon_url?: null | string;
            image?: null | {
                height: number;
                size: "Large" | "Preview";
                url: string;
                width: number;
            };
            original_url?: null | string;
            site_name?: null | string;
            special?: null | {
                type: "None";
            } | {
                type: "GIF";
            } | {
                id: string;
                timestamp?: null | string;
                type: "YouTube";
            } | {
                content_type: "Channel";
                id: string;
                type: "Lightspeed";
            } | {
                content_type: "Channel" | "Video" | "Clip";
                id: string;
                type: "Twitch";
            } | {
                content_type: string;
                id: string;
                type: "Spotify";
            } | {
                type: "Soundcloud";
            } | {
                content_type: "Album" | "Track";
                id: string;
                type: "Bandcamp";
            } | {
                id: string;
                type: "Streamable";
            };
            title?: null | string;
            type: "Website";
            url?: null | string;
            video?: null | {
                height: number;
                url: string;
                width: number;
            };
        } | {
            height: number;
            size: "Large" | "Preview";
            type: "Image";
            url: string;
            width: number;
        } | {
            height: number;
            type: "Video";
            url: string;
            width: number;
        } | {
            colour?: null | string;
            description?: null | string;
            icon_url?: null | string;
            media?: null | {
                _id: string;
                content_type: string;
                deleted?: null | boolean;
                filename: string;
                message_id?: null | string;
                metadata: {
                    type: "File";
                } | {
                    type: "Text";
                } | {
                    height: number;
                    type: "Image";
                    width: number;
                } | {
                    height: number;
                    type: "Video";
                    width: number;
                } | {
                    type: "Audio";
                };
                object_id?: null | string;
                reported?: null | boolean;
                server_id?: null | string;
                size: number;
                tag: string;
                user_id?: null | string;
            };
            title?: null | string;
            type: "Text";
            url?: null | string;
        } | {
            type: "None";
        })[];
        interactions?: {
            reactions?: null | string[];
            restrict_reactions?: boolean;
        };
        masquerade?: null | {
            avatar?: null | string;
            colour?: null | string;
            name?: null | string;
        };
        mentions?: null | string[];
        nonce?: null | string;
        reactions?: {
            [key: string]: string[];
        };
        replies?: null | string[];
        system?: null | {
            content: string;
            type: "text";
        } | {
            by: string;
            id: string;
            type: "user_added";
        } | {
            by: string;
            id: string;
            type: "user_remove";
        } | {
            id: string;
            type: "user_joined";
        } | {
            id: string;
            type: "user_left";
        } | {
            id: string;
            type: "user_kicked";
        } | {
            id: string;
            type: "user_banned";
        } | {
            by: string;
            name: string;
            type: "channel_renamed";
        } | {
            by: string;
            type: "channel_description_changed";
        } | {
            by: string;
            type: "channel_icon_changed";
        } | {
            from: string;
            to: string;
            type: "channel_ownership_changed";
        };
    }[] | {
        members?: null | {
            _id: {
                server: string;
                user: string;
            };
            avatar?: null | {
                _id: string;
                content_type: string;
                deleted?: null | boolean;
                filename: string;
                message_id?: null | string;
                metadata: {
                    type: "File";
                } | {
                    type: "Text";
                } | {
                    height: number;
                    type: "Image";
                    width: number;
                } | {
                    height: number;
                    type: "Video";
                    width: number;
                } | {
                    type: "Audio";
                };
                object_id?: null | string;
                reported?: null | boolean;
                server_id?: null | string;
                size: number;
                tag: string;
                user_id?: null | string;
            };
            joined_at: string;
            nickname?: null | string;
            roles?: string[];
            timeout?: null | string;
        }[];
        messages: {
            _id: string;
            attachments?: null | {
                _id: string;
                content_type: string;
                deleted?: null | boolean;
                filename: string;
                message_id?: null | string;
                metadata: {
                    type: "File";
                } | {
                    type: "Text";
                } | {
                    height: number;
                    type: "Image";
                    width: number;
                } | {
                    height: number;
                    type: "Video";
                    width: number;
                } | {
                    type: "Audio";
                };
                object_id?: null | string;
                reported?: null | boolean;
                server_id?: null | string;
                size: number;
                tag: string;
                user_id?: null | string;
            }[];
            author: string;
            channel: string;
            content?: null | string;
            edited?: null | string;
            embeds?: null | ({
                colour?: null | string;
                description?: null | string;
                icon_url?: null | string;
                image?: null | {
                    height: number;
                    size: "Large" | "Preview";
                    url: string;
                    width: number;
                };
                original_url?: null | string;
                site_name?: null | string;
                special?: null | {
                    type: "None";
                } | {
                    type: "GIF";
                } | {
                    id: string;
                    timestamp?: null | string;
                    type: "YouTube";
                } | {
                    content_type: "Channel";
                    id: string;
                    type: "Lightspeed";
                } | {
                    content_type: "Channel" | "Video" | "Clip";
                    id: string;
                    type: "Twitch";
                } | {
                    content_type: string;
                    id: string;
                    type: "Spotify";
                } | {
                    type: "Soundcloud";
                } | {
                    content_type: "Album" | "Track";
                    id: string;
                    type: "Bandcamp";
                } | {
                    id: string;
                    type: "Streamable";
                };
                title?: null | string;
                type: "Website";
                url?: null | string;
                video?: null | {
                    height: number;
                    url: string;
                    width: number;
                };
            } | {
                height: number;
                size: "Large" | "Preview";
                type: "Image";
                url: string;
                width: number;
            } | {
                height: number;
                type: "Video";
                url: string;
                width: number;
            } | {
                colour?: null | string;
                description?: null | string;
                icon_url?: null | string;
                media?: null | {
                    _id: string;
                    content_type: string;
                    deleted?: null | boolean;
                    filename: string;
                    message_id?: null | string;
                    metadata: {
                        type: "File";
                    } | {
                        type: "Text";
                    } | {
                        height: number;
                        type: "Image";
                        width: number;
                    } | {
                        height: number;
                        type: "Video";
                        width: number;
                    } | {
                        type: "Audio";
                    };
                    object_id?: null | string;
                    reported?: null | boolean;
                    server_id?: null | string;
                    size: number;
                    tag: string;
                    user_id?: null | string;
                };
                title?: null | string;
                type: "Text";
                url?: null | string;
            } | {
                type: "None";
            })[];
            interactions?: {
                reactions?: null | string[];
                restrict_reactions?: boolean;
            };
            masquerade?: null | {
                avatar?: null | string;
                colour?: null | string;
                name?: null | string;
            };
            mentions?: null | string[];
            nonce?: null | string;
            reactions?: {
                [key: string]: string[];
            };
            replies?: null | string[];
            system?: null | {
                content: string;
                type: "text";
            } | {
                by: string;
                id: string;
                type: "user_added";
            } | {
                by: string;
                id: string;
                type: "user_remove";
            } | {
                id: string;
                type: "user_joined";
            } | {
                id: string;
                type: "user_left";
            } | {
                id: string;
                type: "user_kicked";
            } | {
                id: string;
                type: "user_banned";
            } | {
                by: string;
                name: string;
                type: "channel_renamed";
            } | {
                by: string;
                type: "channel_description_changed";
            } | {
                by: string;
                type: "channel_icon_changed";
            } | {
                from: string;
                to: string;
                type: "channel_ownership_changed";
            };
        }[];
        users: {
            _id: string;
            avatar?: null | {
                _id: string;
                content_type: string;
                deleted?: null | boolean;
                filename: string;
                message_id?: null | string;
                metadata: {
                    type: "File";
                } | {
                    type: "Text";
                } | {
                    height: number;
                    type: "Image";
                    width: number;
                } | {
                    height: number;
                    type: "Video";
                    width: number;
                } | {
                    type: "Audio";
                };
                object_id?: null | string;
                reported?: null | boolean;
                server_id?: null | string;
                size: number;
                tag: string;
                user_id?: null | string;
            };
            badges?: null | number;
            bot?: null | {
                owner: string;
            };
            flags?: null | number;
            online?: null | boolean;
            privileged?: boolean;
            profile?: null | {
                background?: null | {
                    _id: string;
                    content_type: string;
                    deleted?: null | boolean;
                    filename: string;
                    message_id?: null | string;
                    metadata: {
                        type: "File";
                    } | {
                        type: "Text";
                    } | {
                        height: number;
                        type: "Image";
                        width: number;
                    } | {
                        height: number;
                        type: "Video";
                        width: number;
                    } | {
                        type: "Audio";
                    };
                    object_id?: null | string;
                    reported?: null | boolean;
                    server_id?: null | string;
                    size: number;
                    tag: string;
                    user_id?: null | string;
                };
                content?: null | string;
            };
            relations?: null | {
                _id: string;
                status: "User" | "None" | "Friend" | "Outgoing" | "Incoming" | "Blocked" | "BlockedOther";
            }[];
            relationship?: null | "User" | "None" | "Friend" | "Outgoing" | "Incoming" | "Blocked" | "BlockedOther";
            status?: null | {
                presence?: null | "Online" | "Idle" | "Focus" | "Busy" | "Invisible";
                text?: null | string;
            };
            username: string;
        }[];
    }>

Generated using TypeDoc

Class MessageEmbedAbstract

Message Embed

Hierarchy

Constructors

Properties

Methods

Constructors

Properties

client?: Client
type: "None" | "Website" | "Image" | "Video" | "Text"

Methods

  • Create an Embed from an API Embed

    Returns

    Embed

    Parameters

    • client: Client

      Client

    • embed: {
          colour?: null | string;
          description?: null | string;
          icon_url?: null | string;
          image?: null | {
              height: number;
              size: "Large" | "Preview";
              url: string;
              width: number;
          };
          original_url?: null | string;
          site_name?: null | string;
          special?: null | {
              type: "None";
          } | {
              type: "GIF";
          } | {
              id: string;
              timestamp?: null | string;
              type: "YouTube";
          } | {
              content_type: "Channel";
              id: string;
              type: "Lightspeed";
          } | {
              content_type: "Channel" | "Video" | "Clip";
              id: string;
              type: "Twitch";
          } | {
              content_type: string;
              id: string;
              type: "Spotify";
          } | {
              type: "Soundcloud";
          } | {
              content_type: "Album" | "Track";
              id: string;
              type: "Bandcamp";
          } | {
              id: string;
              type: "Streamable";
          };
          title?: null | string;
          type: "Website";
          url?: null | string;
          video?: null | {
              height: number;
              url: string;
              width: number;
          };
      } | {
          height: number;
          size: "Large" | "Preview";
          type: "Image";
          url: string;
          width: number;
      } | {
          height: number;
          type: "Video";
          url: string;
          width: number;
      } | {
          colour?: null | string;
          description?: null | string;
          icon_url?: null | string;
          media?: null | {
              _id: string;
              content_type: string;
              deleted?: null | boolean;
              filename: string;
              message_id?: null | string;
              metadata: {
                  type: "File";
              } | {
                  type: "Text";
              } | {
                  height: number;
                  type: "Image";
                  width: number;
              } | {
                  height: number;
                  type: "Video";
                  width: number;
              } | {
                  type: "Audio";
              };
              object_id?: null | string;
              reported?: null | boolean;
              server_id?: null | string;
              size: number;
              tag: string;
              user_id?: null | string;
          };
          title?: null | string;
          type: "Text";
          url?: null | string;
      } | {
          type: "None";
      }

      Data

    Returns MessageEmbed

Generated using TypeDoc

Class PublicBot

Public Bot Class

Hierarchy

  • PublicBot

Constructors

  • Construct Public Bot

    Parameters

    • client: Client

      Client

    • data: {
          _id: string;
          avatar?: null | {
              _id: string;
              content_type: string;
              deleted?: null | boolean;
              filename: string;
              message_id?: null | string;
              metadata: {
                  type: "File";
              } | {
                  type: "Text";
              } | {
                  height: number;
                  type: "Image";
                  width: number;
              } | {
                  height: number;
                  type: "Video";
                  width: number;
              } | {
                  type: "Audio";
              };
              object_id?: null | string;
              reported?: null | boolean;
              server_id?: null | string;
              size: number;
              tag: string;
              user_id?: null | string;
          };
          description?: null | string;
          username: string;
      }

      Data

      • _id: string

        Description

        Bot Id

      • Optional avatar?: null | {
            _id: string;
            content_type: string;
            deleted?: null | boolean;
            filename: string;
            message_id?: null | string;
            metadata: {
                type: "File";
            } | {
                type: "Text";
            } | {
                height: number;
                type: "Image";
                width: number;
            } | {
                height: number;
                type: "Video";
                width: number;
            } | {
                type: "Audio";
            };
            object_id?: null | string;
            reported?: null | boolean;
            server_id?: null | string;
            size: number;
            tag: string;
            user_id?: null | string;
        }

        Description

        Profile Avatar

      • Optional description?: null | string

        Description

        Profile Description

      • username: string

        Description

        Bot Username

    Returns PublicBot

Properties

#client: Client
avatar?: File
description?: string
id: string
username: string

Methods

Generated using TypeDoc

Class PublicChannelInviteAbstract

Public Channel Invite

Hierarchy

Constructors

Properties

Methods

Constructors

Properties

client?: Client
type: "Server" | "None" | "Group"

Methods

  • Create an Invite from an API Invite Response

    Returns

    Invite

    Parameters

    • client: Client

      Client

    • invite: {
          channel_description?: null | string;
          channel_id: string;
          channel_name: string;
          code: string;
          member_count: number;
          server_banner?: null | {
              _id: string;
              content_type: string;
              deleted?: null | boolean;
              filename: string;
              message_id?: null | string;
              metadata: {
                  type: "File";
              } | {
                  type: "Text";
              } | {
                  height: number;
                  type: "Image";
                  width: number;
              } | {
                  height: number;
                  type: "Video";
                  width: number;
              } | {
                  type: "Audio";
              };
              object_id?: null | string;
              reported?: null | boolean;
              server_id?: null | string;
              size: number;
              tag: string;
              user_id?: null | string;
          };
          server_flags?: null | number;
          server_icon?: null | {
              _id: string;
              content_type: string;
              deleted?: null | boolean;
              filename: string;
              message_id?: null | string;
              metadata: {
                  type: "File";
              } | {
                  type: "Text";
              } | {
                  height: number;
                  type: "Image";
                  width: number;
              } | {
                  height: number;
                  type: "Video";
                  width: number;
              } | {
                  type: "Audio";
              };
              object_id?: null | string;
              reported?: null | boolean;
              server_id?: null | string;
              size: number;
              tag: string;
              user_id?: null | string;
          };
          server_id: string;
          server_name: string;
          type: "Server";
          user_avatar?: null | {
              _id: string;
              content_type: string;
              deleted?: null | boolean;
              filename: string;
              message_id?: null | string;
              metadata: {
                  type: "File";
              } | {
                  type: "Text";
              } | {
                  height: number;
                  type: "Image";
                  width: number;
              } | {
                  height: number;
                  type: "Video";
                  width: number;
              } | {
                  type: "Audio";
              };
              object_id?: null | string;
              reported?: null | boolean;
              server_id?: null | string;
              size: number;
              tag: string;
              user_id?: null | string;
          };
          user_name: string;
      } | {
          channel_description?: null | string;
          channel_id: string;
          channel_name: string;
          code: string;
          type: "Group";
          user_avatar?: null | {
              _id: string;
              content_type: string;
              deleted?: null | boolean;
              filename: string;
              message_id?: null | string;
              metadata: {
                  type: "File";
              } | {
                  type: "Text";
              } | {
                  height: number;
                  type: "Image";
                  width: number;
              } | {
                  height: number;
                  type: "Video";
                  width: number;
              } | {
                  type: "Audio";
              };
              object_id?: null | string;
              reported?: null | boolean;
              server_id?: null | string;
              size: number;
              tag: string;
              user_id?: null | string;
          };
          user_name: string;
      }

      Data

    Returns PublicChannelInvite

Generated using TypeDoc

Class Server

Server Class

Hierarchy

  • Server

Constructors

Properties

#collection: ServerCollection
id: string

Accessors

  • get animatedIconURL(): undefined | string
  • URL to the server's animated icon

    Returns undefined | string

  • get bannerURL(): undefined | string
  • URL to the server's banner

    Returns undefined | string

  • get categories(): undefined | {
        channels: string[];
        id: string;
        title: string;
    }[]
  • Categories

    Returns undefined | {
        channels: string[];
        id: string;
        title: string;
    }[]

  • get discoverable(): boolean
  • Whether this server is publicly discoverable

    Returns boolean

  • get mentions(): string[]
  • Find all message IDs of unread messages

    Returns

    Array of message IDs which are unread

    Returns string[]

  • get orderedChannels(): (Omit<{
        channels: string[];
        id: string;
        title: string;
    }, "channels"> & {
        channels: Channel[];
    })[]
  • Get an array of ordered categories with their respective channels. Uncategorised channels are returned in id="default" category.

    Returns (Omit<{
        channels: string[];
        id: string;
        title: string;
    }, "channels"> & {
        channels: Channel[];
    })[]

  • get orderedRoles(): {
        colour?: null | string;
        hoist?: boolean;
        id: string;
        name: string;
        permissions: {
            a: number;
            d: number;
        };
        rank?: number;
    }[]
  • Get an ordered array of roles with their IDs attached. The highest ranking roles will be first followed by lower ranking roles. This is dictated by the "rank" property which is smaller for higher priority roles.

    Returns {
        colour?: null | string;
        hoist?: boolean;
        id: string;
        name: string;
        permissions: {
            a: number;
            d: number;
        };
        rank?: number;
    }[]

  • get permission(): number
  • Permission the currently authenticated user has against this server

    Returns number

  • get roles(): ReactiveMap<string, {
        colour?: null | string;
        hoist?: boolean;
        name: string;
        permissions: {
            a: number;
            d: number;
        };
        rank?: number;
    }>
  • Roles

    Returns ReactiveMap<string, {
        colour?: null | string;
        hoist?: boolean;
        name: string;
        permissions: {
            a: number;
            d: number;
        };
        rank?: number;
    }>

  • get systemMessages(): undefined | {
        user_banned?: null | string;
        user_joined?: null | string;
        user_kicked?: null | string;
        user_left?: null | string;
    }
  • System message channels

    Returns undefined | {
        user_banned?: null | string;
        user_joined?: null | string;
        user_kicked?: null | string;
        user_left?: null | string;
    }

Methods

  • Ban user from this server

    Parameters

    • user: string | User | ServerMember

      User

    • options: {
          reason?: null | string;
      } = {}

      Ban options

      • Optional reason?: null | string

        Description

        Ban reason

    Returns Promise<ServerBan>

  • Create a channel

    Returns

    The newly-created channel

    Parameters

    • data: {
          description?: null | string;
          name: string;
          nsfw?: null | boolean;
          type?: "Text" | "Voice";
      }

      Channel create route data

      • Optional description?: null | string

        Description

        Channel description

      • name: string

        Description

        Channel name

      • Optional nsfw?: null | boolean

        Description

        Whether this channel is age restricted

      • Optional type?: "Text" | "Voice"

        Description

        Channel type

        Default

        Text
        

    Returns Promise<Channel>

  • Create an emoji on the server

    Parameters

    • autumnId: string

      Autumn Id

    • options: Omit<{
          name: string;
          nsfw?: boolean;
          parent: {
              id: string;
              type: "Server";
          } | {
              type: "Detached";
          };
      }, "parent">

      Options

    Returns Promise<Emoji>

  • Create role

    Parameters

    • name: string

      Role name

    Returns Promise<{
        id: string;
        role: {
            colour?: null | string;
            hoist?: boolean;
            name: string;
            permissions: {
                a: number;
                d: number;
            };
            rank?: number;
        };
    }>

  • Delete or leave a server

    Parameters

    • Optional leaveSilently: boolean

      Whether to not send a message on leave

    Returns Promise<void>

  • Delete role

    Parameters

    • roleId: string

      Role ID

    Returns Promise<undefined>

  • Edit a server

    Parameters

    • data: {
          analytics?: null | boolean;
          banner?: null | string;
          categories?: null | {
              channels: string[];
              id: string;
              title: string;
          }[];
          description?: null | string;
          discoverable?: null | boolean;
          flags?: null | number;
          icon?: null | string;
          name?: null | string;
          remove?: null | ("Description" | "Icon" | "Categories" | "SystemMessages" | "Banner")[];
          system_messages?: null | {
              user_banned?: null | string;
              user_joined?: null | string;
              user_kicked?: null | string;
              user_left?: null | string;
          };
      }

      Changes

      • Optional analytics?: null | boolean

        Description

        Whether analytics should be collected for this server

        Must be enabled in order to show up on Revolt Discover.

      • Optional banner?: null | string

        Description

        Attachment Id for banner

      • Optional categories?: null | {
            channels: string[];
            id: string;
            title: string;
        }[]

        Description

        Category structure for server

      • Optional description?: null | string

        Description

        Server description

      • Optional discoverable?: null | boolean

        Description

        Whether this server is public and should show up on Revolt Discover

      • Optional flags?: null | number

        Format: int32

        Description

        Bitfield of server flags

      • Optional icon?: null | string

        Description

        Attachment Id for icon

      • Optional name?: null | string

        Description

        Server name

      • Optional remove?: null | ("Description" | "Icon" | "Categories" | "SystemMessages" | "Banner")[]

        Description

        Fields to remove from server object

      • Optional system_messages?: null | {
            user_banned?: null | string;
            user_joined?: null | string;
            user_kicked?: null | string;
            user_left?: null | string;
        }

        Description

        System message configuration

    Returns Promise<void>

  • Edit a role

    Parameters

    • roleId: string

      Role ID

    • data: {
          colour?: null | string;
          hoist?: null | boolean;
          name?: null | string;
          rank?: null | number;
          remove?: null | "Colour"[];
      }

      Role editing route data

      • Optional colour?: null | string

        Description

        Role colour

      • Optional hoist?: null | boolean

        Description

        Whether this role should be displayed separately

      • Optional name?: null | string

        Description

        Role name

      • Optional rank?: null | number

        Format: int64

        Description

        Ranking position

        Smaller values take priority.

      • Optional remove?: null | "Colour"[]

        Description

        Fields to remove from role object

    Returns Promise<{
        colour?: null | string;
        hoist?: boolean;
        name: string;
        permissions: {
            a: number;
            d: number;
        };
        rank?: number;
    }>

  • Fetch a server's members

    Returns

    List of the server's members and their user objects

    Returns Promise<{
        members: ServerMember[];
        users: User[];
    }>

  • Check whether we have a given permission in a server

    Returns

    Whether we have this permission

    Parameters

    • Rest ...permission: ("Masquerade" | "Video" | "ManageChannel" | "ManageServer" | "ManagePermissions" | "ManageRole" | "ManageCustomisation" | "KickMembers" | "BanMembers" | "TimeoutMembers" | "AssignRoles" | "ChangeNickname" | "ManageNicknames" | "ChangeAvatar" | "RemoveAvatars" | "ViewChannel" | "ReadMessageHistory" | "SendMessage" | "ManageMessages" | "ManageWebhooks" | "InviteOthers" | "SendEmbeds" | "UploadFiles" | "React" | "Connect" | "Speak" | "MuteMembers" | "DeafenMembers" | "MoveMembers" | "GrantAllSafe")[]

      Permission Names

    Returns boolean

  • Check whether we have at least one of the given permissions in a server

    Returns

    Whether we have one of the permissions

    Parameters

    • Rest ...permission: ("Masquerade" | "Video" | "ManageChannel" | "ManageServer" | "ManagePermissions" | "ManageRole" | "ManageCustomisation" | "KickMembers" | "BanMembers" | "TimeoutMembers" | "AssignRoles" | "ChangeNickname" | "ManageNicknames" | "ChangeAvatar" | "RemoveAvatars" | "ViewChannel" | "ReadMessageHistory" | "SendMessage" | "ManageMessages" | "ManageWebhooks" | "InviteOthers" | "SendEmbeds" | "UploadFiles" | "React" | "Connect" | "Speak" | "MuteMembers" | "DeafenMembers" | "MoveMembers" | "GrantAllSafe")[]

      Permission Names

    Returns boolean

  • Set role permissions

    Parameters

    • roleId: string = "default"

      Role Id, set to 'default' to affect all users

    • permissions: number | {
          allow: number;
          deny: number;
      }

      Permission value

    Returns Promise<{
        _id: string;
        analytics?: boolean;
        banner?: null | {
            _id: string;
            content_type: string;
            deleted?: null | boolean;
            filename: string;
            message_id?: null | string;
            metadata: {
                type: "File";
            } | {
                type: "Text";
            } | {
                height: number;
                type: "Image";
                width: number;
            } | {
                height: number;
                type: "Video";
                width: number;
            } | {
                type: "Audio";
            };
            object_id?: null | string;
            reported?: null | boolean;
            server_id?: null | string;
            size: number;
            tag: string;
            user_id?: null | string;
        };
        categories?: null | {
            channels: string[];
            id: string;
            title: string;
        }[];
        channels: string[];
        default_permissions: number;
        description?: null | string;
        discoverable?: boolean;
        flags?: null | number;
        icon?: null | {
            _id: string;
            content_type: string;
            deleted?: null | boolean;
            filename: string;
            message_id?: null | string;
            metadata: {
                type: "File";
            } | {
                type: "Text";
            } | {
                height: number;
                type: "Image";
                width: number;
            } | {
                height: number;
                type: "Video";
                width: number;
            } | {
                type: "Audio";
            };
            object_id?: null | string;
            reported?: null | boolean;
            server_id?: null | string;
            size: number;
            tag: string;
            user_id?: null | string;
        };
        name: string;
        nsfw?: boolean;
        owner: string;
        roles?: {
            [key: string]: components["schemas"]["Role"];
        };
        system_messages?: null | {
            user_banned?: null | string;
            user_joined?: null | string;
            user_kicked?: null | string;
            user_left?: null | string;
        };
    }>

  • Optimised member fetch route

    Parameters

    • Optional excludeOffline: boolean

    Returns Promise<void>

  • Pardon user's ban

    Parameters

    • user: string | User

      User

    Returns Promise<undefined>

Generated using TypeDoc

Class ServerBan

Server Ban

Hierarchy

  • ServerBan

Constructors

Properties

Accessors

Methods

Constructors

  • Construct Server Ban

    Parameters

    • client: Client

      Client

    • data: {
          _id: {
              server: string;
              user: string;
          };
          reason?: null | string;
      }

      Data

      • _id: {
            server: string;
            user: string;
        }

        Description

        Unique member id

        • server: string

          Description

          Server Id

        • user: string

          Description

          User Id

      • Optional reason?: null | string

        Description

        Reason for ban creation

    Returns ServerBan

Properties

client: Client
id: {
    server: string;
    user: string;
}

Type declaration

  • server: string

    Description

    Server Id

  • user: string

    Description

    User Id

reason?: string

Accessors

Methods

Generated using TypeDoc

Class ServerCollection

Collection of Servers

Hierarchy

Constructors

Properties

#objects: ReactiveMap<string, Server> = ...
#storage: ObjectStorage<HydratedServer> = ...
client: Client
getUnderlyingObject: ((id: string) => HydratedServer)

Type declaration

    • (id: string): HydratedServer
    • Parameters

      • id: string

      Returns HydratedServer

updateUnderlyingObject: SetStoreFunction<Record<string, HydratedServer>>

Methods

  • Create a new instance of an object

    Parameters

    • id: string

      Id

    • type: "channel" | "user" | "server" | "bot" | "channelUnread" | "emoji" | "message" | "serverMember"

      Type

    • instance: Server

      Instance

    • context: unknown

      Context

    • Optional data: unknown

      Data

    Returns void

  • Create a server

    Returns

    The newly-created server

    Parameters

    • data: {
          description?: null | string;
          name: string;
          nsfw?: null | boolean;
      }

      Server options

      • Optional description?: null | string

        Description

        Server description

      • name: string

        Description

        Server name

      • Optional nsfw?: null | boolean

        Description

        Whether this server is age-restricted

    Returns Promise<Server>

  • Execute a provided function over each key, value pair in the map

    Returns

    Iterable

    Parameters

    • cb: ((value: Server, key: string, map: ReactiveMap<string, Server>) => void)

      Callback for each pair

        • (value: Server, key: string, map: ReactiveMap<string, Server>): void
        • Parameters

          Returns void

    Returns void

  • Get or create

    Parameters

    • id: string

      Id

    • data: {
          _id: string;
          analytics?: boolean;
          banner?: null | {
              _id: string;
              content_type: string;
              deleted?: null | boolean;
              filename: string;
              message_id?: null | string;
              metadata: {
                  type: "File";
              } | {
                  type: "Text";
              } | {
                  height: number;
                  type: "Image";
                  width: number;
              } | {
                  height: number;
                  type: "Video";
                  width: number;
              } | {
                  type: "Audio";
              };
              object_id?: null | string;
              reported?: null | boolean;
              server_id?: null | string;
              size: number;
              tag: string;
              user_id?: null | string;
          };
          categories?: null | {
              channels: string[];
              id: string;
              title: string;
          }[];
          channels: string[];
          default_permissions: number;
          description?: null | string;
          discoverable?: boolean;
          flags?: null | number;
          icon?: null | {
              _id: string;
              content_type: string;
              deleted?: null | boolean;
              filename: string;
              message_id?: null | string;
              metadata: {
                  type: "File";
              } | {
                  type: "Text";
              } | {
                  height: number;
                  type: "Image";
                  width: number;
              } | {
                  height: number;
                  type: "Video";
                  width: number;
              } | {
                  type: "Audio";
              };
              object_id?: null | string;
              reported?: null | boolean;
              server_id?: null | string;
              size: number;
              tag: string;
              user_id?: null | string;
          };
          name: string;
          nsfw?: boolean;
          owner: string;
          roles?: {
              [key: string]: components["schemas"]["Role"];
          };
          system_messages?: null | {
              user_banned?: null | string;
              user_joined?: null | string;
              user_kicked?: null | string;
              user_left?: null | string;
          };
      }

      Data

      • _id: string

        Description

        Unique Id

      • Optional analytics?: boolean

        Description

        Whether to enable analytics

      • Optional banner?: null | {
            _id: string;
            content_type: string;
            deleted?: null | boolean;
            filename: string;
            message_id?: null | string;
            metadata: {
                type: "File";
            } | {
                type: "Text";
            } | {
                height: number;
                type: "Image";
                width: number;
            } | {
                height: number;
                type: "Video";
                width: number;
            } | {
                type: "Audio";
            };
            object_id?: null | string;
            reported?: null | boolean;
            server_id?: null | string;
            size: number;
            tag: string;
            user_id?: null | string;
        }

        Description

        Banner attachment

      • Optional categories?: null | {
            channels: string[];
            id: string;
            title: string;
        }[]

        Description

        Categories for this server

      • channels: string[]

        Description

        Channels within this server

      • default_permissions: number

        Format: int64

        Description

        Default set of server and channel permissions

      • Optional description?: null | string

        Description

        Description for the server

      • Optional discoverable?: boolean

        Description

        Whether this server should be publicly discoverable

      • Optional flags?: null | number

        Format: int32

        Description

        Bitfield of server flags

      • Optional icon?: null | {
            _id: string;
            content_type: string;
            deleted?: null | boolean;
            filename: string;
            message_id?: null | string;
            metadata: {
                type: "File";
            } | {
                type: "Text";
            } | {
                height: number;
                type: "Image";
                width: number;
            } | {
                height: number;
                type: "Video";
                width: number;
            } | {
                type: "Audio";
            };
            object_id?: null | string;
            reported?: null | boolean;
            server_id?: null | string;
            size: number;
            tag: string;
            user_id?: null | string;
        }

        Description

        Icon attachment

      • name: string

        Description

        Name of the server

      • Optional nsfw?: boolean

        Description

        Whether this server is flagged as not safe for work

      • owner: string

        Description

        User id of the owner

      • Optional roles?: {
            [key: string]: components["schemas"]["Role"];
        }

        Description

        Roles for this server

        • [key: string]: components["schemas"]["Role"]
      • Optional system_messages?: null | {
            user_banned?: null | string;
            user_joined?: null | string;
            user_kicked?: null | string;
            user_left?: null | string;
        }

        Description

        Configuration for sending system event messages

    • isNew: boolean = false

      Whether this object is new

    Returns Server

Generated using TypeDoc

Class ServerInvite

Server Invite

Hierarchy

Constructors

Properties

Accessors

Methods

Constructors

Properties

channelId: string
client?: Client
creatorId: string
id: string
serverId: string
type: "Server" | "None" | "Group"

Accessors

Methods

  • Create an Invite from an API Invite

    Returns

    Invite

    Parameters

    • client: Client

      Client

    • invite: {
          _id: string;
          channel: string;
          creator: string;
          server: string;
          type: "Server";
      } | {
          _id: string;
          channel: string;
          creator: string;
          type: "Group";
      }

      Data

    Returns ChannelInvite

Generated using TypeDoc

Class ServerMember

Server Member Class

Hierarchy

  • ServerMember

Constructors

Properties

id: {
    server: string;
    user: string;
}

Type declaration

  • server: string

    Description

    Server Id

  • user: string

    Description

    User Id

Accessors

  • get hoistedRole(): null | {
        colour?: null | string;
        hoist?: boolean;
        id: string;
        name?: string;
        permissions?: {
            a: number;
            d: number;
        };
        rank?: number;
    }
  • Member's currently hoisted role.

    Returns null | {
        colour?: null | string;
        hoist?: boolean;
        id: string;
        name?: string;
        permissions?: {
            a: number;
            d: number;
        };
        rank?: number;
    }

  • get orderedRoles(): {
        colour?: null | string;
        hoist?: boolean;
        id: string;
        name?: string;
        permissions?: {
            a: number;
            d: number;
        };
        rank?: number;
    }[]
  • Ordered list of roles for this member, from lowest to highest priority.

    Returns {
        colour?: null | string;
        hoist?: boolean;
        id: string;
        name?: string;
        permissions?: {
            a: number;
            d: number;
        };
        rank?: number;
    }[]

Methods

  • Ban this member from the server

    Parameters

    • options: {
          reason?: null | string;
      }

      Ban options

      • Optional reason?: null | string

        Description

        Ban reason

    Returns Promise<void>

  • Edit a member

    Parameters

    • data: {
          avatar?: null | string;
          nickname?: null | string;
          remove?: null | ("Nickname" | "Avatar" | "Roles" | "Timeout")[];
          roles?: null | string[];
          timeout?: null | string;
      }

      Changes

      • Optional avatar?: null | string

        Description

        Attachment Id to set for avatar

      • Optional nickname?: null | string

        Description

        Member nickname

      • Optional remove?: null | ("Nickname" | "Avatar" | "Roles" | "Timeout")[]

        Description

        Fields to remove from channel object

      • Optional roles?: null | string[]

        Description

        Array of role ids

      • Optional timeout?: null | string

        Description

        Timestamp this member is timed out until

    Returns Promise<void>

  • Get the permissions that this member has against a certain object

    Returns

    Permissions that this member has

    Parameters

    • target: Server | Channel

      Target object to check permissions against

    Returns number

  • Check whether a member has a certain permission against a certain object

    Returns

    Whether the member has this permission

    Parameters

    • target: Server | Channel

      Target object to check permissions against

    • Rest ...permission: ("Masquerade" | "Video" | "ManageChannel" | "ManageServer" | "ManagePermissions" | "ManageRole" | "ManageCustomisation" | "KickMembers" | "BanMembers" | "TimeoutMembers" | "AssignRoles" | "ChangeNickname" | "ManageNicknames" | "ChangeAvatar" | "RemoveAvatars" | "ViewChannel" | "ReadMessageHistory" | "SendMessage" | "ManageMessages" | "ManageWebhooks" | "InviteOthers" | "SendEmbeds" | "UploadFiles" | "React" | "Connect" | "Speak" | "MuteMembers" | "DeafenMembers" | "MoveMembers" | "GrantAllSafe")[]

      Permission names to check for

    Returns boolean

  • Checks whether the target member has a higher rank than this member.

    Returns

    Whether this member is inferior to the target

    Parameters

    Returns boolean

Generated using TypeDoc

Class ServerMemberCollection

Collection of Server Members

Hierarchy

Constructors

Properties

#objects: ReactiveMap<string, ServerMember> = ...
#storage: ObjectStorage<HydratedServerMember> = ...
client: Client
getUnderlyingObject: ((id: string) => HydratedServerMember)

Type declaration

    • (id: string): HydratedServerMember
    • Parameters

      • id: string

      Returns HydratedServerMember

updateUnderlyingObject: SetStoreFunction<Record<string, HydratedServerMember>>

Methods

  • Create a new instance of an object

    Parameters

    • id: string

      Id

    • type: "channel" | "user" | "server" | "bot" | "channelUnread" | "emoji" | "message" | "serverMember"

      Type

    • instance: ServerMember

      Instance

    • context: unknown

      Context

    • Optional data: unknown

      Data

    Returns void

  • Get member by composite key

    Returns

    Member

    Parameters

    • id: {
          server: string;
          user: string;
      }

      Id

      • server: string

        Description

        Server Id

      • user: string

        Description

        User Id

    Returns undefined | ServerMember

  • Get or create

    Parameters

    • id: {
          server: string;
          user: string;
      }

      Id

      • server: string

        Description

        Server Id

      • user: string

        Description

        User Id

    • data: {
          _id: {
              server: string;
              user: string;
          };
          avatar?: null | {
              _id: string;
              content_type: string;
              deleted?: null | boolean;
              filename: string;
              message_id?: null | string;
              metadata: {
                  type: "File";
              } | {
                  type: "Text";
              } | {
                  height: number;
                  type: "Image";
                  width: number;
              } | {
                  height: number;
                  type: "Video";
                  width: number;
              } | {
                  type: "Audio";
              };
              object_id?: null | string;
              reported?: null | boolean;
              server_id?: null | string;
              size: number;
              tag: string;
              user_id?: null | string;
          };
          joined_at: string;
          nickname?: null | string;
          roles?: string[];
          timeout?: null | string;
      }

      Data

      • _id: {
            server: string;
            user: string;
        }

        Description

        Unique member id

        • server: string

          Description

          Server Id

        • user: string

          Description

          User Id

      • Optional avatar?: null | {
            _id: string;
            content_type: string;
            deleted?: null | boolean;
            filename: string;
            message_id?: null | string;
            metadata: {
                type: "File";
            } | {
                type: "Text";
            } | {
                height: number;
                type: "Image";
                width: number;
            } | {
                height: number;
                type: "Video";
                width: number;
            } | {
                type: "Audio";
            };
            object_id?: null | string;
            reported?: null | boolean;
            server_id?: null | string;
            size: number;
            tag: string;
            user_id?: null | string;
        }

        Description

        Avatar attachment

      • joined_at: string

        Description

        Time at which this user joined the server

      • Optional nickname?: null | string

        Description

        Member's nickname

      • Optional roles?: string[]

        Description

        Member's roles

      • Optional timeout?: null | string

        Description

        Timestamp this member is timed out until

    Returns ServerMember

  • Get or return partial

    Parameters

    • id: {
          server: string;
          user: string;
      }

      Id

      • server: string

        Description

        Server Id

      • user: string

        Description

        User Id

    Returns undefined | ServerMember

  • Check if member exists by composite key

    Returns

    Whether it exists

    Parameters

    • id: {
          server: string;
          user: string;
      }

      Id

      • server: string

        Description

        Server Id

      • user: string

        Description

        User Id

    Returns boolean

Generated using TypeDoc

Class ServerPublicInvite

Public Server Invite

Hierarchy

Constructors

Properties

channelDescription?: string
channelId: string
channelName: string
client?: Client
code: string
memberCount: number
serverBanner?: File
serverFlags: ServerFlags
serverIcon?: File
serverId: string
serverName: string
type: "Server" | "None" | "Group"
userAvatar?: File
userName: string

Methods

  • Create an Invite from an API Invite Response

    Returns

    Invite

    Parameters

    • client: Client

      Client

    • invite: {
          channel_description?: null | string;
          channel_id: string;
          channel_name: string;
          code: string;
          member_count: number;
          server_banner?: null | {
              _id: string;
              content_type: string;
              deleted?: null | boolean;
              filename: string;
              message_id?: null | string;
              metadata: {
                  type: "File";
              } | {
                  type: "Text";
              } | {
                  height: number;
                  type: "Image";
                  width: number;
              } | {
                  height: number;
                  type: "Video";
                  width: number;
              } | {
                  type: "Audio";
              };
              object_id?: null | string;
              reported?: null | boolean;
              server_id?: null | string;
              size: number;
              tag: string;
              user_id?: null | string;
          };
          server_flags?: null | number;
          server_icon?: null | {
              _id: string;
              content_type: string;
              deleted?: null | boolean;
              filename: string;
              message_id?: null | string;
              metadata: {
                  type: "File";
              } | {
                  type: "Text";
              } | {
                  height: number;
                  type: "Image";
                  width: number;
              } | {
                  height: number;
                  type: "Video";
                  width: number;
              } | {
                  type: "Audio";
              };
              object_id?: null | string;
              reported?: null | boolean;
              server_id?: null | string;
              size: number;
              tag: string;
              user_id?: null | string;
          };
          server_id: string;
          server_name: string;
          type: "Server";
          user_avatar?: null | {
              _id: string;
              content_type: string;
              deleted?: null | boolean;
              filename: string;
              message_id?: null | string;
              metadata: {
                  type: "File";
              } | {
                  type: "Text";
              } | {
                  height: number;
                  type: "Image";
                  width: number;
              } | {
                  height: number;
                  type: "Video";
                  width: number;
              } | {
                  type: "Audio";
              };
              object_id?: null | string;
              reported?: null | boolean;
              server_id?: null | string;
              size: number;
              tag: string;
              user_id?: null | string;
          };
          user_name: string;
      } | {
          channel_description?: null | string;
          channel_id: string;
          channel_name: string;
          code: string;
          type: "Group";
          user_avatar?: null | {
              _id: string;
              content_type: string;
              deleted?: null | boolean;
              filename: string;
              message_id?: null | string;
              metadata: {
                  type: "File";
              } | {
                  type: "Text";
              } | {
                  height: number;
                  type: "Image";
                  width: number;
              } | {
                  height: number;
                  type: "Video";
                  width: number;
              } | {
                  type: "Audio";
              };
              object_id?: null | string;
              reported?: null | boolean;
              server_id?: null | string;
              size: number;
              tag: string;
              user_id?: null | string;
          };
          user_name: string;
      }

      Data

    Returns PublicChannelInvite

Generated using TypeDoc

Class StoreCollection<T, V>Abstract

Collection backed by a Solid.js Store

Type Parameters

  • T

  • V

Hierarchy

Constructors

Properties

#objects: ReactiveMap<string, T> = ...
#storage: ObjectStorage<V> = ...
getUnderlyingObject: ((id: string) => V)

Type declaration

    • (id: string): V
    • Parameters

      • id: string

      Returns V

updateUnderlyingObject: SetStoreFunction<Record<string, V>>

Methods

  • Create a new instance of an object

    Parameters

    • id: string

      Id

    • type: "channel" | "user" | "server" | "bot" | "channelUnread" | "emoji" | "message" | "serverMember"

      Type

    • instance: T

      Instance

    • context: unknown

      Context

    • Optional data: unknown

      Data

    Returns void

  • Filter the collection by a given predicate

    Parameters

    • predicate: ((value: T, key: string) => boolean)

      Predicate to satisfy

        • (value: T, key: string): boolean
        • Parameters

          • value: T
          • key: string

          Returns boolean

    Returns T[]

  • Find some value based on a predicate

    Parameters

    • predicate: ((value: T, key: string) => boolean)

      Predicate to satisfy

        • (value: T, key: string): boolean
        • Parameters

          • value: T
          • key: string

          Returns boolean

    Returns undefined | T

  • Execute a provided function over each key, value pair in the map

    Returns

    Iterable

    Parameters

    • cb: ((value: T, key: string, map: ReactiveMap<string, T>) => void)

      Callback for each pair

        • (value: T, key: string, map: ReactiveMap<string, T>): void
        • Parameters

          • value: T
          • key: string
          • map: ReactiveMap<string, T>

          Returns void

    Returns void

  • Check whether an object is partially defined

    Returns

    Whether it is a partial

    Parameters

    • id: string

      Id

    Returns boolean

  • Map the collection using a given callback

    Type Parameters

    • O

    Parameters

    • cb: ((value: T, key: string) => O)

      Callback

        • (value: T, key: string): O
        • Parameters

          • value: T
          • key: string

          Returns O

    Returns O[]

Generated using TypeDoc

Class SystemMessageAbstract

System Message

Hierarchy

Constructors

Properties

Methods

Constructors

  • Construct System Message

    Parameters

    • client: Client

      Client

    • type: "text" | "user_added" | "user_remove" | "user_joined" | "user_left" | "user_kicked" | "user_banned" | "channel_renamed" | "channel_description_changed" | "channel_icon_changed" | "channel_ownership_changed"

      Type

    Returns SystemMessage

Properties

client?: Client
type: "text" | "user_added" | "user_remove" | "user_joined" | "user_left" | "user_kicked" | "user_banned" | "channel_renamed" | "channel_description_changed" | "channel_icon_changed" | "channel_ownership_changed"

Methods

  • Create an System Message from an API System Message

    Returns

    System Message

    Parameters

    • client: Client

      Client

    • message: {
          content: string;
          type: "text";
      } | {
          by: string;
          id: string;
          type: "user_added";
      } | {
          by: string;
          id: string;
          type: "user_remove";
      } | {
          id: string;
          type: "user_joined";
      } | {
          id: string;
          type: "user_left";
      } | {
          id: string;
          type: "user_kicked";
      } | {
          id: string;
          type: "user_banned";
      } | {
          by: string;
          name: string;
          type: "channel_renamed";
      } | {
          by: string;
          type: "channel_description_changed";
      } | {
          by: string;
          type: "channel_icon_changed";
      } | {
          from: string;
          to: string;
          type: "channel_ownership_changed";
      }

    Returns SystemMessage

Generated using TypeDoc

Class TextEmbed

Text Embed

Hierarchy

Constructors

Properties

client?: Client
colour?: string
description?: string
iconUrl?: string
media?: File
title?: string
type: "None" | "Website" | "Image" | "Video" | "Text"
url?: string

Accessors

Methods

  • Create an Embed from an API Embed

    Returns

    Embed

    Parameters

    • client: Client

      Client

    • embed: {
          colour?: null | string;
          description?: null | string;
          icon_url?: null | string;
          image?: null | {
              height: number;
              size: "Large" | "Preview";
              url: string;
              width: number;
          };
          original_url?: null | string;
          site_name?: null | string;
          special?: null | {
              type: "None";
          } | {
              type: "GIF";
          } | {
              id: string;
              timestamp?: null | string;
              type: "YouTube";
          } | {
              content_type: "Channel";
              id: string;
              type: "Lightspeed";
          } | {
              content_type: "Channel" | "Video" | "Clip";
              id: string;
              type: "Twitch";
          } | {
              content_type: string;
              id: string;
              type: "Spotify";
          } | {
              type: "Soundcloud";
          } | {
              content_type: "Album" | "Track";
              id: string;
              type: "Bandcamp";
          } | {
              id: string;
              type: "Streamable";
          };
          title?: null | string;
          type: "Website";
          url?: null | string;
          video?: null | {
              height: number;
              url: string;
              width: number;
          };
      } | {
          height: number;
          size: "Large" | "Preview";
          type: "Image";
          url: string;
          width: number;
      } | {
          height: number;
          type: "Video";
          url: string;
          width: number;
      } | {
          colour?: null | string;
          description?: null | string;
          icon_url?: null | string;
          media?: null | {
              _id: string;
              content_type: string;
              deleted?: null | boolean;
              filename: string;
              message_id?: null | string;
              metadata: {
                  type: "File";
              } | {
                  type: "Text";
              } | {
                  height: number;
                  type: "Image";
                  width: number;
              } | {
                  height: number;
                  type: "Video";
                  width: number;
              } | {
                  type: "Audio";
              };
              object_id?: null | string;
              reported?: null | boolean;
              server_id?: null | string;
              size: number;
              tag: string;
              user_id?: null | string;
          };
          title?: null | string;
          type: "Text";
          url?: null | string;
      } | {
          type: "None";
      }

      Data

    Returns MessageEmbed

Generated using TypeDoc

Class TextSystemMessage

Text System Message

Hierarchy

Constructors

Properties

Methods

Constructors

Properties

client?: Client
content: string
type: "text" | "user_added" | "user_remove" | "user_joined" | "user_left" | "user_kicked" | "user_banned" | "channel_renamed" | "channel_description_changed" | "channel_icon_changed" | "channel_ownership_changed"

Methods

  • Create an System Message from an API System Message

    Returns

    System Message

    Parameters

    • client: Client

      Client

    • message: {
          content: string;
          type: "text";
      } | {
          by: string;
          id: string;
          type: "user_added";
      } | {
          by: string;
          id: string;
          type: "user_remove";
      } | {
          id: string;
          type: "user_joined";
      } | {
          id: string;
          type: "user_left";
      } | {
          id: string;
          type: "user_kicked";
      } | {
          id: string;
          type: "user_banned";
      } | {
          by: string;
          name: string;
          type: "channel_renamed";
      } | {
          by: string;
          type: "channel_description_changed";
      } | {
          by: string;
          type: "channel_icon_changed";
      } | {
          from: string;
          to: string;
          type: "channel_ownership_changed";
      }

    Returns SystemMessage

Generated using TypeDoc

Class UnknownEmbed

Embed of unknown type

Hierarchy

Constructors

Properties

Methods

Constructors

Properties

client?: Client
type: "None" | "Website" | "Image" | "Video" | "Text"

Methods

  • Create an Embed from an API Embed

    Returns

    Embed

    Parameters

    • client: Client

      Client

    • embed: {
          colour?: null | string;
          description?: null | string;
          icon_url?: null | string;
          image?: null | {
              height: number;
              size: "Large" | "Preview";
              url: string;
              width: number;
          };
          original_url?: null | string;
          site_name?: null | string;
          special?: null | {
              type: "None";
          } | {
              type: "GIF";
          } | {
              id: string;
              timestamp?: null | string;
              type: "YouTube";
          } | {
              content_type: "Channel";
              id: string;
              type: "Lightspeed";
          } | {
              content_type: "Channel" | "Video" | "Clip";
              id: string;
              type: "Twitch";
          } | {
              content_type: string;
              id: string;
              type: "Spotify";
          } | {
              type: "Soundcloud";
          } | {
              content_type: "Album" | "Track";
              id: string;
              type: "Bandcamp";
          } | {
              id: string;
              type: "Streamable";
          };
          title?: null | string;
          type: "Website";
          url?: null | string;
          video?: null | {
              height: number;
              url: string;
              width: number;
          };
      } | {
          height: number;
          size: "Large" | "Preview";
          type: "Image";
          url: string;
          width: number;
      } | {
          height: number;
          type: "Video";
          url: string;
          width: number;
      } | {
          colour?: null | string;
          description?: null | string;
          icon_url?: null | string;
          media?: null | {
              _id: string;
              content_type: string;
              deleted?: null | boolean;
              filename: string;
              message_id?: null | string;
              metadata: {
                  type: "File";
              } | {
                  type: "Text";
              } | {
                  height: number;
                  type: "Image";
                  width: number;
              } | {
                  height: number;
                  type: "Video";
                  width: number;
              } | {
                  type: "Audio";
              };
              object_id?: null | string;
              reported?: null | boolean;
              server_id?: null | string;
              size: number;
              tag: string;
              user_id?: null | string;
          };
          title?: null | string;
          type: "Text";
          url?: null | string;
      } | {
          type: "None";
      }

      Data

    Returns MessageEmbed

Generated using TypeDoc

Class UnknownInvite

Invite of unknown type

Hierarchy

Constructors

Properties

Methods

Constructors

Properties

client?: Client
type: "Server" | "None" | "Group"

Methods

  • Create an Invite from an API Invite

    Returns

    Invite

    Parameters

    • client: Client

      Client

    • invite: {
          _id: string;
          channel: string;
          creator: string;
          server: string;
          type: "Server";
      } | {
          _id: string;
          channel: string;
          creator: string;
          type: "Group";
      }

      Data

    Returns ChannelInvite

Generated using TypeDoc

Class UnknownPublicInvite

Public invite of unknown type

Hierarchy

Constructors

Properties

Methods

Constructors

Properties

client?: Client
type: "Server" | "None" | "Group"

Methods

  • Create an Invite from an API Invite Response

    Returns

    Invite

    Parameters

    • client: Client

      Client

    • invite: {
          channel_description?: null | string;
          channel_id: string;
          channel_name: string;
          code: string;
          member_count: number;
          server_banner?: null | {
              _id: string;
              content_type: string;
              deleted?: null | boolean;
              filename: string;
              message_id?: null | string;
              metadata: {
                  type: "File";
              } | {
                  type: "Text";
              } | {
                  height: number;
                  type: "Image";
                  width: number;
              } | {
                  height: number;
                  type: "Video";
                  width: number;
              } | {
                  type: "Audio";
              };
              object_id?: null | string;
              reported?: null | boolean;
              server_id?: null | string;
              size: number;
              tag: string;
              user_id?: null | string;
          };
          server_flags?: null | number;
          server_icon?: null | {
              _id: string;
              content_type: string;
              deleted?: null | boolean;
              filename: string;
              message_id?: null | string;
              metadata: {
                  type: "File";
              } | {
                  type: "Text";
              } | {
                  height: number;
                  type: "Image";
                  width: number;
              } | {
                  height: number;
                  type: "Video";
                  width: number;
              } | {
                  type: "Audio";
              };
              object_id?: null | string;
              reported?: null | boolean;
              server_id?: null | string;
              size: number;
              tag: string;
              user_id?: null | string;
          };
          server_id: string;
          server_name: string;
          type: "Server";
          user_avatar?: null | {
              _id: string;
              content_type: string;
              deleted?: null | boolean;
              filename: string;
              message_id?: null | string;
              metadata: {
                  type: "File";
              } | {
                  type: "Text";
              } | {
                  height: number;
                  type: "Image";
                  width: number;
              } | {
                  height: number;
                  type: "Video";
                  width: number;
              } | {
                  type: "Audio";
              };
              object_id?: null | string;
              reported?: null | boolean;
              server_id?: null | string;
              size: number;
              tag: string;
              user_id?: null | string;
          };
          user_name: string;
      } | {
          channel_description?: null | string;
          channel_id: string;
          channel_name: string;
          code: string;
          type: "Group";
          user_avatar?: null | {
              _id: string;
              content_type: string;
              deleted?: null | boolean;
              filename: string;
              message_id?: null | string;
              metadata: {
                  type: "File";
              } | {
                  type: "Text";
              } | {
                  height: number;
                  type: "Image";
                  width: number;
              } | {
                  height: number;
                  type: "Video";
                  width: number;
              } | {
                  type: "Audio";
              };
              object_id?: null | string;
              reported?: null | boolean;
              server_id?: null | string;
              size: number;
              tag: string;
              user_id?: null | string;
          };
          user_name: string;
      }

      Data

    Returns PublicChannelInvite

Generated using TypeDoc

Class User

User Class

Hierarchy

  • User

Constructors

Properties

#collection: UserCollection
id: string

Accessors

  • get animatedAvatarURL(): string
  • URL to the user's animated avatar

    Returns string

  • get bot(): undefined | {
        owner: string;
    }
  • Bot information

    Returns undefined | {
        owner: string;
    }

  • get createdAt(): Date
  • Time when this user created their account

    Returns Date

  • get relationship(): "User" | "None" | "Friend" | "Outgoing" | "Incoming" | "Blocked" | "BlockedOther"
  • Relationship with user

    Returns "User" | "None" | "Friend" | "Outgoing" | "Incoming" | "Blocked" | "BlockedOther"

  • get status(): undefined | {
        presence?: null | "Online" | "Idle" | "Focus" | "Busy" | "Invisible";
        text?: null | string;
    }
  • User Status

    Returns undefined | {
        presence?: null | "Online" | "Idle" | "Focus" | "Busy" | "Invisible";
        text?: null | string;
    }

Methods

  • Change the username of the current user

    Parameters

    • username: string

      New username

    • password: string

      Current password

    Returns Promise<{
        _id: string;
        avatar?: null | {
            _id: string;
            content_type: string;
            deleted?: null | boolean;
            filename: string;
            message_id?: null | string;
            metadata: {
                type: "File";
            } | {
                type: "Text";
            } | {
                height: number;
                type: "Image";
                width: number;
            } | {
                height: number;
                type: "Video";
                width: number;
            } | {
                type: "Audio";
            };
            object_id?: null | string;
            reported?: null | boolean;
            server_id?: null | string;
            size: number;
            tag: string;
            user_id?: null | string;
        };
        badges?: null | number;
        bot?: null | {
            owner: string;
        };
        flags?: null | number;
        online?: null | boolean;
        privileged?: boolean;
        profile?: null | {
            background?: null | {
                _id: string;
                content_type: string;
                deleted?: null | boolean;
                filename: string;
                message_id?: null | string;
                metadata: {
                    type: "File";
                } | {
                    type: "Text";
                } | {
                    height: number;
                    type: "Image";
                    width: number;
                } | {
                    height: number;
                    type: "Video";
                    width: number;
                } | {
                    type: "Audio";
                };
                object_id?: null | string;
                reported?: null | boolean;
                server_id?: null | string;
                size: number;
                tag: string;
                user_id?: null | string;
            };
            content?: null | string;
        };
        relations?: null | {
            _id: string;
            status: "User" | "None" | "Friend" | "Outgoing" | "Incoming" | "Blocked" | "BlockedOther";
        }[];
        relationship?: null | "User" | "None" | "Friend" | "Outgoing" | "Incoming" | "Blocked" | "BlockedOther";
        status?: null | {
            presence?: null | "Online" | "Idle" | "Focus" | "Busy" | "Invisible";
            text?: null | string;
        };
        username: string;
    }>

  • Edit the user

    Parameters

    • data: {
          avatar?: null | string;
          badges?: null | number;
          flags?: null | number;
          profile?: null | {
              background?: null | string;
              content?: null | string;
          };
          remove?: null | ("Avatar" | "StatusText" | "StatusPresence" | "ProfileContent" | "ProfileBackground")[];
          status?: null | {
              presence?: null | "Online" | "Idle" | "Focus" | "Busy" | "Invisible";
              text?: null | string;
          };
      }

      Changes

      • Optional avatar?: null | string

        Description

        Attachment Id for avatar

      • Optional badges?: null | number

        Format: int32

        Description

        Bitfield of user badges

      • Optional flags?: null | number

        Format: int32

        Description

        Enum of user flags

      • Optional profile?: null | {
            background?: null | string;
            content?: null | string;
        }

        Description

        New user profile data

        This is applied as a partial.

      • Optional remove?: null | ("Avatar" | "StatusText" | "StatusPresence" | "ProfileContent" | "ProfileBackground")[]

        Description

        Fields to remove from user object

      • Optional status?: null | {
            presence?: null | "Online" | "Idle" | "Focus" | "Busy" | "Invisible";
            text?: null | string;
        }

        Description

        New user status

    Returns Promise<void>

  • Fetch the mutual connections of the current user and a target user

    Returns

    The mutual connections of the current user and a target user

    Returns Promise<{
        servers: string[];
        users: string[];
    }>

  • Fetch the profile of a user

    Returns

    The profile of the user

    Returns Promise<{
        background?: null | {
            _id: string;
            content_type: string;
            deleted?: null | boolean;
            filename: string;
            message_id?: null | string;
            metadata: {
                type: "File";
            } | {
                type: "Text";
            } | {
                height: number;
                type: "Image";
                width: number;
            } | {
                height: number;
                type: "Video";
                width: number;
            } | {
                type: "Audio";
            };
            object_id?: null | string;
            reported?: null | boolean;
            server_id?: null | string;
            size: number;
            tag: string;
            user_id?: null | string;
        };
        content?: null | string;
    }>

  • Remove a user from the friend list

    Returns Promise<void>

  • Write to string as a user mention

    Returns

    Formatted String

    Returns string

Generated using TypeDoc

Class UserCollection

Collection of Users

Hierarchy

Constructors

Properties

#objects: ReactiveMap<string, User> = ...
#storage: ObjectStorage<HydratedUser> = ...
client: Client
getUnderlyingObject: ((id: string) => HydratedUser)

Type declaration

    • (id: string): HydratedUser
    • Parameters

      • id: string

      Returns HydratedUser

updateUnderlyingObject: SetStoreFunction<Record<string, HydratedUser>>

Methods

  • Create a new instance of an object

    Parameters

    • id: string

      Id

    • type: "channel" | "user" | "server" | "bot" | "channelUnread" | "emoji" | "message" | "serverMember"

      Type

    • instance: User

      Instance

    • context: unknown

      Context

    • Optional data: unknown

      Data

    Returns void

  • Find some value based on a predicate

    Parameters

    • predicate: ((value: User, key: string) => boolean)

      Predicate to satisfy

        • (value: User, key: string): boolean
        • Parameters

          • value: User
          • key: string

          Returns boolean

    Returns undefined | User

  • Execute a provided function over each key, value pair in the map

    Returns

    Iterable

    Parameters

    • cb: ((value: User, key: string, map: ReactiveMap<string, User>) => void)

      Callback for each pair

        • (value: User, key: string, map: ReactiveMap<string, User>): void
        • Parameters

          • value: User
          • key: string
          • map: ReactiveMap<string, User>

          Returns void

    Returns void

  • Get or create

    Parameters

    • id: string

      Id

    • data: {
          _id: string;
          avatar?: null | {
              _id: string;
              content_type: string;
              deleted?: null | boolean;
              filename: string;
              message_id?: null | string;
              metadata: {
                  type: "File";
              } | {
                  type: "Text";
              } | {
                  height: number;
                  type: "Image";
                  width: number;
              } | {
                  height: number;
                  type: "Video";
                  width: number;
              } | {
                  type: "Audio";
              };
              object_id?: null | string;
              reported?: null | boolean;
              server_id?: null | string;
              size: number;
              tag: string;
              user_id?: null | string;
          };
          badges?: null | number;
          bot?: null | {
              owner: string;
          };
          flags?: null | number;
          online?: null | boolean;
          privileged?: boolean;
          profile?: null | {
              background?: null | {
                  _id: string;
                  content_type: string;
                  deleted?: null | boolean;
                  filename: string;
                  message_id?: null | string;
                  metadata: {
                      type: "File";
                  } | {
                      type: "Text";
                  } | {
                      height: number;
                      type: "Image";
                      width: number;
                  } | {
                      height: number;
                      type: "Video";
                      width: number;
                  } | {
                      type: "Audio";
                  };
                  object_id?: null | string;
                  reported?: null | boolean;
                  server_id?: null | string;
                  size: number;
                  tag: string;
                  user_id?: null | string;
              };
              content?: null | string;
          };
          relations?: null | {
              _id: string;
              status: "User" | "None" | "Friend" | "Outgoing" | "Incoming" | "Blocked" | "BlockedOther";
          }[];
          relationship?: null | "User" | "None" | "Friend" | "Outgoing" | "Incoming" | "Blocked" | "BlockedOther";
          status?: null | {
              presence?: null | "Online" | "Idle" | "Focus" | "Busy" | "Invisible";
              text?: null | string;
          };
          username: string;
      }

      Data

      • _id: string

        Description

        Unique Id

      • Optional avatar?: null | {
            _id: string;
            content_type: string;
            deleted?: null | boolean;
            filename: string;
            message_id?: null | string;
            metadata: {
                type: "File";
            } | {
                type: "Text";
            } | {
                height: number;
                type: "Image";
                width: number;
            } | {
                height: number;
                type: "Video";
                width: number;
            } | {
                type: "Audio";
            };
            object_id?: null | string;
            reported?: null | boolean;
            server_id?: null | string;
            size: number;
            tag: string;
            user_id?: null | string;
        }

        Description

        Avatar attachment

      • Optional badges?: null | number

        Format: int32

        Description

        Bitfield of user badges

      • Optional bot?: null | {
            owner: string;
        }

        Description

        Bot information

      • Optional flags?: null | number

        Format: int32

        Description

        Enum of user flags

      • Optional online?: null | boolean

        Description

        Whether this user is currently online

      • Optional privileged?: boolean

        Description

        Whether this user is privileged

      • Optional profile?: null | {
            background?: null | {
                _id: string;
                content_type: string;
                deleted?: null | boolean;
                filename: string;
                message_id?: null | string;
                metadata: {
                    type: "File";
                } | {
                    type: "Text";
                } | {
                    height: number;
                    type: "Image";
                    width: number;
                } | {
                    height: number;
                    type: "Video";
                    width: number;
                } | {
                    type: "Audio";
                };
                object_id?: null | string;
                reported?: null | boolean;
                server_id?: null | string;
                size: number;
                tag: string;
                user_id?: null | string;
            };
            content?: null | string;
        }

        Description

        User's profile page

      • Optional relations?: null | {
            _id: string;
            status: "User" | "None" | "Friend" | "Outgoing" | "Incoming" | "Blocked" | "BlockedOther";
        }[]

        Description

        Relationships with other users

      • Optional relationship?: null | "User" | "None" | "Friend" | "Outgoing" | "Incoming" | "Blocked" | "BlockedOther"

        Description

        Current session user's relationship with this user

      • Optional status?: null | {
            presence?: null | "Online" | "Idle" | "Focus" | "Busy" | "Invisible";
            text?: null | string;
        }

        Description

        User's current status

      • username: string

        Description

        Username

    Returns User

  • Map the collection using a given callback

    Type Parameters

    • O

    Parameters

    • cb: ((value: User, key: string) => O)

      Callback

        • (value: User, key: string): O
        • Parameters

          • value: User
          • key: string

          Returns O

    Returns O[]

Generated using TypeDoc

Class UserModeratedSystemMessage

User Moderated System Message

Hierarchy

Constructors

Properties

Accessors

Methods

Constructors

  • Construct System Message

    Parameters

    • client: Client

      Client

    • systemMessage: ({
          content: string;
          type: "text";
      } | {
          by: string;
          id: string;
          type: "user_added";
      } | {
          by: string;
          id: string;
          type: "user_remove";
      } | {
          id: string;
          type: "user_joined";
      } | {
          id: string;
          type: "user_left";
      } | {
          id: string;
          type: "user_kicked";
      } | {
          id: string;
          type: "user_banned";
      } | {
          by: string;
          name: string;
          type: "channel_renamed";
      } | {
          by: string;
          type: "channel_description_changed";
      } | {
          by: string;
          type: "channel_icon_changed";
      } | {
          from: string;
          to: string;
          type: "channel_ownership_changed";
      }) & {
          type: "user_added" | "user_remove";
      }

      System Message

    Returns UserModeratedSystemMessage

Properties

byId: string
client?: Client
type: "text" | "user_added" | "user_remove" | "user_joined" | "user_left" | "user_kicked" | "user_banned" | "channel_renamed" | "channel_description_changed" | "channel_icon_changed" | "channel_ownership_changed"
userId: string

Accessors

Methods

  • Create an System Message from an API System Message

    Returns

    System Message

    Parameters

    • client: Client

      Client

    • message: {
          content: string;
          type: "text";
      } | {
          by: string;
          id: string;
          type: "user_added";
      } | {
          by: string;
          id: string;
          type: "user_remove";
      } | {
          id: string;
          type: "user_joined";
      } | {
          id: string;
          type: "user_left";
      } | {
          id: string;
          type: "user_kicked";
      } | {
          id: string;
          type: "user_banned";
      } | {
          by: string;
          name: string;
          type: "channel_renamed";
      } | {
          by: string;
          type: "channel_description_changed";
      } | {
          by: string;
          type: "channel_icon_changed";
      } | {
          from: string;
          to: string;
          type: "channel_ownership_changed";
      }

    Returns SystemMessage

Generated using TypeDoc

Class UserSystemMessage

User System Message

Hierarchy

Constructors

Properties

Accessors

Methods

Constructors

  • Construct System Message

    Parameters

    • client: Client

      Client

    • systemMessage: ({
          content: string;
          type: "text";
      } | {
          by: string;
          id: string;
          type: "user_added";
      } | {
          by: string;
          id: string;
          type: "user_remove";
      } | {
          id: string;
          type: "user_joined";
      } | {
          id: string;
          type: "user_left";
      } | {
          id: string;
          type: "user_kicked";
      } | {
          id: string;
          type: "user_banned";
      } | {
          by: string;
          name: string;
          type: "channel_renamed";
      } | {
          by: string;
          type: "channel_description_changed";
      } | {
          by: string;
          type: "channel_icon_changed";
      } | {
          from: string;
          to: string;
          type: "channel_ownership_changed";
      }) & {
          type: "user_added" | "user_remove" | "user_joined" | "user_left" | "user_kicked" | "user_banned";
      }

      System Message

    Returns UserSystemMessage

Properties

client?: Client
type: "text" | "user_added" | "user_remove" | "user_joined" | "user_left" | "user_kicked" | "user_banned" | "channel_renamed" | "channel_description_changed" | "channel_icon_changed" | "channel_ownership_changed"
userId: string

Accessors

Methods

  • Create an System Message from an API System Message

    Returns

    System Message

    Parameters

    • client: Client

      Client

    • message: {
          content: string;
          type: "text";
      } | {
          by: string;
          id: string;
          type: "user_added";
      } | {
          by: string;
          id: string;
          type: "user_remove";
      } | {
          id: string;
          type: "user_joined";
      } | {
          id: string;
          type: "user_left";
      } | {
          id: string;
          type: "user_kicked";
      } | {
          id: string;
          type: "user_banned";
      } | {
          by: string;
          name: string;
          type: "channel_renamed";
      } | {
          by: string;
          type: "channel_description_changed";
      } | {
          by: string;
          type: "channel_icon_changed";
      } | {
          from: string;
          to: string;
          type: "channel_ownership_changed";
      }

    Returns SystemMessage

Generated using TypeDoc

Class VideoEmbed

Video Embed

Hierarchy

Constructors

Properties

Accessors

Methods

Constructors

Properties

client?: Client
height: number
type: "None" | "Website" | "Image" | "Video" | "Text"
url: string
width: number

Accessors

Methods

  • Create an Embed from an API Embed

    Returns

    Embed

    Parameters

    • client: Client

      Client

    • embed: {
          colour?: null | string;
          description?: null | string;
          icon_url?: null | string;
          image?: null | {
              height: number;
              size: "Large" | "Preview";
              url: string;
              width: number;
          };
          original_url?: null | string;
          site_name?: null | string;
          special?: null | {
              type: "None";
          } | {
              type: "GIF";
          } | {
              id: string;
              timestamp?: null | string;
              type: "YouTube";
          } | {
              content_type: "Channel";
              id: string;
              type: "Lightspeed";
          } | {
              content_type: "Channel" | "Video" | "Clip";
              id: string;
              type: "Twitch";
          } | {
              content_type: string;
              id: string;
              type: "Spotify";
          } | {
              type: "Soundcloud";
          } | {
              content_type: "Album" | "Track";
              id: string;
              type: "Bandcamp";
          } | {
              id: string;
              type: "Streamable";
          };
          title?: null | string;
          type: "Website";
          url?: null | string;
          video?: null | {
              height: number;
              url: string;
              width: number;
          };
      } | {
          height: number;
          size: "Large" | "Preview";
          type: "Image";
          url: string;
          width: number;
      } | {
          height: number;
          type: "Video";
          url: string;
          width: number;
      } | {
          colour?: null | string;
          description?: null | string;
          icon_url?: null | string;
          media?: null | {
              _id: string;
              content_type: string;
              deleted?: null | boolean;
              filename: string;
              message_id?: null | string;
              metadata: {
                  type: "File";
              } | {
                  type: "Text";
              } | {
                  height: number;
                  type: "Image";
                  width: number;
              } | {
                  height: number;
                  type: "Video";
                  width: number;
              } | {
                  type: "Audio";
              };
              object_id?: null | string;
              reported?: null | boolean;
              server_id?: null | string;
              size: number;
              tag: string;
              user_id?: null | string;
          };
          title?: null | string;
          type: "Text";
          url?: null | string;
      } | {
          type: "None";
      }

      Data

    Returns MessageEmbed

Generated using TypeDoc

Class WebsiteEmbed

Website Embed

Hierarchy

Constructors

Properties

client?: Client
colour?: string
description?: string
iconUrl?: string
image?: ImageEmbed
originalUrl?: string
siteName?: string
specialContent?: {
    type: "None";
} | {
    type: "GIF";
} | {
    id: string;
    timestamp?: null | string;
    type: "YouTube";
} | {
    content_type: "Channel";
    id: string;
    type: "Lightspeed";
} | {
    content_type: "Channel" | "Video" | "Clip";
    id: string;
    type: "Twitch";
} | {
    content_type: string;
    id: string;
    type: "Spotify";
} | {
    type: "Soundcloud";
} | {
    content_type: "Album" | "Track";
    id: string;
    type: "Bandcamp";
} | {
    id: string;
    type: "Streamable";
}
title?: string
type: "None" | "Website" | "Image" | "Video" | "Text"
url?: string
video?: VideoEmbed

Accessors

  • get embedURL(): undefined | string
  • If special content is present, generate the embed URL

    Returns undefined | string

Methods

  • Create an Embed from an API Embed

    Returns

    Embed

    Parameters

    • client: Client

      Client

    • embed: {
          colour?: null | string;
          description?: null | string;
          icon_url?: null | string;
          image?: null | {
              height: number;
              size: "Large" | "Preview";
              url: string;
              width: number;
          };
          original_url?: null | string;
          site_name?: null | string;
          special?: null | {
              type: "None";
          } | {
              type: "GIF";
          } | {
              id: string;
              timestamp?: null | string;
              type: "YouTube";
          } | {
              content_type: "Channel";
              id: string;
              type: "Lightspeed";
          } | {
              content_type: "Channel" | "Video" | "Clip";
              id: string;
              type: "Twitch";
          } | {
              content_type: string;
              id: string;
              type: "Spotify";
          } | {
              type: "Soundcloud";
          } | {
              content_type: "Album" | "Track";
              id: string;
              type: "Bandcamp";
          } | {
              id: string;
              type: "Streamable";
          };
          title?: null | string;
          type: "Website";
          url?: null | string;
          video?: null | {
              height: number;
              url: string;
              width: number;
          };
      } | {
          height: number;
          size: "Large" | "Preview";
          type: "Image";
          url: string;
          width: number;
      } | {
          height: number;
          type: "Video";
          url: string;
          width: number;
      } | {
          colour?: null | string;
          description?: null | string;
          icon_url?: null | string;
          media?: null | {
              _id: string;
              content_type: string;
              deleted?: null | boolean;
              filename: string;
              message_id?: null | string;
              metadata: {
                  type: "File";
              } | {
                  type: "Text";
              } | {
                  height: number;
                  type: "Image";
                  width: number;
              } | {
                  height: number;
                  type: "Video";
                  width: number;
              } | {
                  type: "Audio";
              };
              object_id?: null | string;
              reported?: null | boolean;
              server_id?: null | string;
              size: number;
              tag: string;
              user_id?: null | string;
          };
          title?: null | string;
          type: "Text";
          url?: null | string;
      } | {
          type: "None";
      }

      Data

    Returns MessageEmbed

Generated using TypeDoc

Enumeration BotFlags

Flags attributed to users

Generated using TypeDoc

Enumeration ConnectionState

All possible event client states.

Enumeration Members

Enumeration Members

Connected: 2
Connecting: 1
Disconnected: 3
Idle: 0

Generated using TypeDoc

Enumeration ServerFlags

Flags attributed to servers

Enumeration Members

Enumeration Members

Official: 1
Verified: 2

Generated using TypeDoc

Enumeration UserBadges

Badges available to users

Enumeration Members

ActiveSupporter: 64
Developer: 1
EarlyAdopter: 256
Founder: 16
Paw: 128
PlatformModeration: 32
ReservedRelevantJokeBadge1: 512
ReservedRelevantJokeBadge2: 1024
ResponsibleDisclosure: 8
Supporter: 4
Translator: 2

Generated using TypeDoc

Enumeration UserFlags

Flags attributed to users

Enumeration Members

Enumeration Members

Banned: 4
Deleted: 2
Suspended: 1

Generated using TypeDoc

Function getPathName

  • Get the specific path name of any given path.

    Returns

    Specific path

    Parameters

    • anyPath: string

      Any path

    Returns string | undefined

Generated using TypeDoc

Interface Options

Client configuration options

Hierarchy

  • Options

Properties

Properties

authentication: {
    rauth?: string;
    revolt?: string | {
        token: string;
    };
}

Authentication used for requests

Type declaration

  • Optional rauth?: string
  • Optional revolt?: string | {
        token: string;
    }
baseURL: string

Base URL of the Revolt node

Generated using TypeDoc

Namespace API

Index

Classes

Interfaces

Type Aliases

AccountInfo AllMemberResponse Authifier_Error BanListResult BandcampType BannedUser Bot BotInformation BotResponse BuildInformation BulkMessageResponse CaptchaFeature Category Channel ChannelCompositeKey ChannelType ChannelUnread CollectionScans CollectionStats ContentReportReason CreateServerResponse CreateVoiceUserResponse Data DataAccountDeletion DataBanCreate DataChangeEmail DataChangePassword DataChangeUsername DataCreateAccount DataCreateBot DataCreateChannel DataCreateEmoji DataCreateGroup DataCreateRole DataCreateServer DataDefaultChannelPermissions DataEditBot DataEditChannel DataEditMessage DataEditReport DataEditRole DataEditServer DataEditSession DataEditUser DataHello DataLogin DataMemberEdit DataMessageSend DataOnboard DataPasswordReset DataReportContent DataResendVerification DataSendFriendRequest DataSendPasswordReset DataSetServerDefaultPermission DataSetServerRolePermission Embed Emoji EmojiParent Error Feature FieldsBot FieldsChannel FieldsMember FieldsRole FieldsServer FieldsUser File FlagResponse ISO8601_Timestamp Id Image ImageSize Index IndexAccess Interactions Invite InviteBotDestination InviteJoinResponse InviteResponse LatencyHistogramEntry LatencyStats LightspeedType MFAMethod MFAResponse MFATicket Masquerade Member MemberCompositeKey Message MessageQuery MessageSort Metadata MultiFactorStatus MutualResponse NewRoleResponse OptionsBulkDelete OptionsFetchSettings OptionsMessageSearch OptionsQueryStale Override OverrideField OwnedBotsResponse Permission Presence PublicBot QueryExecStats Relationship RelationshipStatus Reply Report ReportStatus ReportedContent ResponseLogin ResponseTotpSecret ResponseVerify RevoltConfig RevoltFeatures Role SendableEmbed Server ServerBan SessionInfo SnapshotContent SnapshotWithContext Special Stats SystemMessage SystemMessageChannels TwitchType User UserPermission UserProfile UserProfileData UserReportReason UserStatus Video VoiceFeature WebPushSubscription

Functions

Generated using TypeDoc

Type alias AccountInfo

AccountInfo: components["schemas"]["AccountInfo"]

Generated using TypeDoc

Type alias AllMemberResponse

AllMemberResponse: components["schemas"]["AllMemberResponse"]

Generated using TypeDoc

Type alias Authifier_Error

Authifier_Error: components["schemas"]["Authifier Error"]

Generated using TypeDoc

Type alias BandcampType

BandcampType: components["schemas"]["BandcampType"]

Generated using TypeDoc

Type alias BanListResult

BanListResult: components["schemas"]["BanListResult"]

Generated using TypeDoc

Type alias BannedUser

BannedUser: components["schemas"]["BannedUser"]

Generated using TypeDoc

Type alias Bot

Bot: components["schemas"]["Bot"]

Generated using TypeDoc

Type alias BotInformation

BotInformation: components["schemas"]["BotInformation"]

Generated using TypeDoc

Type alias BotResponse

BotResponse: components["schemas"]["BotResponse"]

Generated using TypeDoc

Type alias BuildInformation

BuildInformation: components["schemas"]["BuildInformation"]

Generated using TypeDoc

Type alias BulkMessageResponse

BulkMessageResponse: components["schemas"]["BulkMessageResponse"]

Generated using TypeDoc

Type alias CaptchaFeature

CaptchaFeature: components["schemas"]["CaptchaFeature"]

Generated using TypeDoc

Type alias Category

Category: components["schemas"]["Category"]

Generated using TypeDoc

Type alias Channel

Channel: components["schemas"]["Channel"]

Generated using TypeDoc

Type alias ChannelCompositeKey

ChannelCompositeKey: components["schemas"]["ChannelCompositeKey"]

Generated using TypeDoc

Type alias ChannelType

ChannelType: components["schemas"]["ChannelType"]

Generated using TypeDoc

Type alias ChannelUnread

ChannelUnread: components["schemas"]["ChannelUnread"]

Generated using TypeDoc

Type alias CollectionScans

CollectionScans: components["schemas"]["CollectionScans"]

Generated using TypeDoc

Type alias CollectionStats

CollectionStats: components["schemas"]["CollectionStats"]

Generated using TypeDoc

Type alias ContentReportReason

ContentReportReason: components["schemas"]["ContentReportReason"]

Generated using TypeDoc

Type alias CreateServerResponse

CreateServerResponse: components["schemas"]["CreateServerResponse"]

Generated using TypeDoc

Type alias CreateVoiceUserResponse

CreateVoiceUserResponse: components["schemas"]["CreateVoiceUserResponse"]

Generated using TypeDoc

Type alias Data

Data: components["schemas"]["Data"]

Generated using TypeDoc

Type alias DataAccountDeletion

DataAccountDeletion: components["schemas"]["DataAccountDeletion"]

Generated using TypeDoc

Type alias DataBanCreate

DataBanCreate: components["schemas"]["DataBanCreate"]

Generated using TypeDoc

Type alias DataChangeEmail

DataChangeEmail: components["schemas"]["DataChangeEmail"]

Generated using TypeDoc

Type alias DataChangePassword

DataChangePassword: components["schemas"]["DataChangePassword"]

Generated using TypeDoc

Type alias DataChangeUsername

DataChangeUsername: components["schemas"]["DataChangeUsername"]

Generated using TypeDoc

Type alias DataCreateAccount

DataCreateAccount: components["schemas"]["DataCreateAccount"]

Generated using TypeDoc

Type alias DataCreateBot

DataCreateBot: components["schemas"]["DataCreateBot"]

Generated using TypeDoc

Type alias DataCreateChannel

DataCreateChannel: components["schemas"]["DataCreateChannel"]

Generated using TypeDoc

Type alias DataCreateEmoji

DataCreateEmoji: components["schemas"]["DataCreateEmoji"]

Generated using TypeDoc

Type alias DataCreateGroup

DataCreateGroup: components["schemas"]["DataCreateGroup"]

Generated using TypeDoc

Type alias DataCreateRole

DataCreateRole: components["schemas"]["DataCreateRole"]

Generated using TypeDoc

Type alias DataCreateServer

DataCreateServer: components["schemas"]["DataCreateServer"]

Generated using TypeDoc

Type alias DataDefaultChannelPermissions

DataDefaultChannelPermissions: components["schemas"]["DataDefaultChannelPermissions"]

Generated using TypeDoc

Type alias DataEditBot

DataEditBot: components["schemas"]["DataEditBot"]

Generated using TypeDoc

Type alias DataEditChannel

DataEditChannel: components["schemas"]["DataEditChannel"]

Generated using TypeDoc

Type alias DataEditMessage

DataEditMessage: components["schemas"]["DataEditMessage"]

Generated using TypeDoc

Type alias DataEditReport

DataEditReport: components["schemas"]["DataEditReport"]

Generated using TypeDoc

Type alias DataEditRole

DataEditRole: components["schemas"]["DataEditRole"]

Generated using TypeDoc

Type alias DataEditServer

DataEditServer: components["schemas"]["DataEditServer"]

Generated using TypeDoc

Type alias DataEditSession

DataEditSession: components["schemas"]["DataEditSession"]

Generated using TypeDoc

Type alias DataEditUser

DataEditUser: components["schemas"]["DataEditUser"]

Generated using TypeDoc

Type alias DataHello

DataHello: components["schemas"]["DataHello"]

Generated using TypeDoc

Type alias DataLogin

DataLogin: components["schemas"]["DataLogin"]

Generated using TypeDoc

Type alias DataMemberEdit

DataMemberEdit: components["schemas"]["DataMemberEdit"]

Generated using TypeDoc

Type alias DataMessageSend

DataMessageSend: components["schemas"]["DataMessageSend"]

Generated using TypeDoc

Type alias DataOnboard

DataOnboard: components["schemas"]["DataOnboard"]

Generated using TypeDoc

Type alias DataPasswordReset

DataPasswordReset: components["schemas"]["DataPasswordReset"]

Generated using TypeDoc

Type alias DataReportContent

DataReportContent: components["schemas"]["DataReportContent"]

Generated using TypeDoc

Type alias DataResendVerification

DataResendVerification: components["schemas"]["DataResendVerification"]

Generated using TypeDoc

Type alias DataSendFriendRequest

DataSendFriendRequest: components["schemas"]["DataSendFriendRequest"]

Generated using TypeDoc

Type alias DataSendPasswordReset

DataSendPasswordReset: components["schemas"]["DataSendPasswordReset"]

Generated using TypeDoc

Type alias DataSetServerDefaultPermission

DataSetServerDefaultPermission: components["schemas"]["DataSetServerDefaultPermission"]

Generated using TypeDoc

Type alias DataSetServerRolePermission

DataSetServerRolePermission: components["schemas"]["DataSetServerRolePermission"]

Generated using TypeDoc

Type alias Embed

Embed: components["schemas"]["Embed"]

Generated using TypeDoc

Type alias Emoji

Emoji: components["schemas"]["Emoji"]

Generated using TypeDoc

Type alias EmojiParent

EmojiParent: components["schemas"]["EmojiParent"]

Generated using TypeDoc

Type alias Error

Error: components["schemas"]["Error"]

Generated using TypeDoc

Type alias Feature

Feature: components["schemas"]["Feature"]

Generated using TypeDoc

Type alias FieldsBot

FieldsBot: components["schemas"]["FieldsBot"]

Generated using TypeDoc

Type alias FieldsChannel

FieldsChannel: components["schemas"]["FieldsChannel"]

Generated using TypeDoc

Type alias FieldsMember

FieldsMember: components["schemas"]["FieldsMember"]

Generated using TypeDoc

Type alias FieldsRole

FieldsRole: components["schemas"]["FieldsRole"]

Generated using TypeDoc

Type alias FieldsServer

FieldsServer: components["schemas"]["FieldsServer"]

Generated using TypeDoc

Type alias FieldsUser

FieldsUser: components["schemas"]["FieldsUser"]

Generated using TypeDoc

Type alias File

File: components["schemas"]["File"]

Generated using TypeDoc

Type alias FlagResponse

FlagResponse: components["schemas"]["FlagResponse"]

Generated using TypeDoc

Type alias Id

Id: components["schemas"]["Id"]

Generated using TypeDoc

Type alias Image

Image: components["schemas"]["Image"]

Generated using TypeDoc

Type alias ImageSize

ImageSize: components["schemas"]["ImageSize"]

Generated using TypeDoc

Type alias Index

Index: components["schemas"]["Index"]

Generated using TypeDoc

Type alias IndexAccess

IndexAccess: components["schemas"]["IndexAccess"]

Generated using TypeDoc

Type alias Interactions

Interactions: components["schemas"]["Interactions"]

Generated using TypeDoc

Type alias Invite

Invite: components["schemas"]["Invite"]

Generated using TypeDoc

Type alias InviteBotDestination

InviteBotDestination: components["schemas"]["InviteBotDestination"]

Generated using TypeDoc

Type alias InviteJoinResponse

InviteJoinResponse: components["schemas"]["InviteJoinResponse"]

Generated using TypeDoc

Type alias InviteResponse

InviteResponse: components["schemas"]["InviteResponse"]

Generated using TypeDoc

Type alias ISO8601_Timestamp

ISO8601_Timestamp: components["schemas"]["ISO8601 Timestamp"]

Generated using TypeDoc

Type alias LatencyHistogramEntry

LatencyHistogramEntry: components["schemas"]["LatencyHistogramEntry"]

Generated using TypeDoc

Type alias LatencyStats

LatencyStats: components["schemas"]["LatencyStats"]

Generated using TypeDoc

Type alias LightspeedType

LightspeedType: components["schemas"]["LightspeedType"]

Generated using TypeDoc

Type alias Masquerade

Masquerade: components["schemas"]["Masquerade"]

Generated using TypeDoc

Type alias Member

Member: components["schemas"]["Member"]

Generated using TypeDoc

Type alias MemberCompositeKey

MemberCompositeKey: components["schemas"]["MemberCompositeKey"]

Generated using TypeDoc

Type alias Message

Message: components["schemas"]["Message"]

Generated using TypeDoc

Type alias MessageQuery

MessageQuery: components["schemas"]["MessageQuery"]

Generated using TypeDoc

Type alias MessageSort

MessageSort: components["schemas"]["MessageSort"]

Generated using TypeDoc

Type alias Metadata

Metadata: components["schemas"]["Metadata"]

Generated using TypeDoc

Type alias MFAMethod

MFAMethod: components["schemas"]["MFAMethod"]

Generated using TypeDoc

Type alias MFAResponse

MFAResponse: components["schemas"]["MFAResponse"]

Generated using TypeDoc

Type alias MFATicket

MFATicket: components["schemas"]["MFATicket"]

Generated using TypeDoc

Type alias MultiFactorStatus

MultiFactorStatus: components["schemas"]["MultiFactorStatus"]

Generated using TypeDoc

Type alias MutualResponse

MutualResponse: components["schemas"]["MutualResponse"]

Generated using TypeDoc

Type alias NewRoleResponse

NewRoleResponse: components["schemas"]["NewRoleResponse"]

Generated using TypeDoc

Type alias OptionsBulkDelete

OptionsBulkDelete: components["schemas"]["OptionsBulkDelete"]

Generated using TypeDoc

Type alias OptionsFetchSettings

OptionsFetchSettings: components["schemas"]["OptionsFetchSettings"]

Generated using TypeDoc

Type alias OptionsMessageSearch

OptionsMessageSearch: components["schemas"]["OptionsMessageSearch"]

Generated using TypeDoc

Type alias OptionsQueryStale

OptionsQueryStale: components["schemas"]["OptionsQueryStale"]

Generated using TypeDoc

Type alias Override

Override: components["schemas"]["Override"]

Generated using TypeDoc

Type alias OverrideField

OverrideField: components["schemas"]["OverrideField"]

Generated using TypeDoc

Type alias OwnedBotsResponse

OwnedBotsResponse: components["schemas"]["OwnedBotsResponse"]

Generated using TypeDoc

Type alias Permission

Permission: components["schemas"]["Permission"]

Generated using TypeDoc

Type alias Presence

Presence: components["schemas"]["Presence"]

Generated using TypeDoc

Type alias PublicBot

PublicBot: components["schemas"]["PublicBot"]

Generated using TypeDoc

Type alias QueryExecStats

QueryExecStats: components["schemas"]["QueryExecStats"]

Generated using TypeDoc

Type alias Relationship

Relationship: components["schemas"]["Relationship"]

Generated using TypeDoc

Type alias RelationshipStatus

RelationshipStatus: components["schemas"]["RelationshipStatus"]

Generated using TypeDoc

Type alias Reply

Reply: components["schemas"]["Reply"]

Generated using TypeDoc

Type alias Report

Report: components["schemas"]["Report"]

Generated using TypeDoc

Type alias ReportedContent

ReportedContent: components["schemas"]["ReportedContent"]

Generated using TypeDoc

Type alias ReportStatus

ReportStatus: components["schemas"]["ReportStatus"]

Generated using TypeDoc

Type alias ResponseLogin

ResponseLogin: components["schemas"]["ResponseLogin"]

Generated using TypeDoc

Type alias ResponseTotpSecret

ResponseTotpSecret: components["schemas"]["ResponseTotpSecret"]

Generated using TypeDoc

Type alias ResponseVerify

ResponseVerify: components["schemas"]["ResponseVerify"]

Generated using TypeDoc

Type alias RevoltConfig

RevoltConfig: components["schemas"]["RevoltConfig"]

Generated using TypeDoc

Type alias RevoltFeatures

RevoltFeatures: components["schemas"]["RevoltFeatures"]

Generated using TypeDoc

Type alias Role

Role: components["schemas"]["Role"]

Generated using TypeDoc

Type alias SendableEmbed

SendableEmbed: components["schemas"]["SendableEmbed"]

Generated using TypeDoc

Type alias Server

Server: components["schemas"]["Server"]

Generated using TypeDoc

Type alias ServerBan

ServerBan: components["schemas"]["ServerBan"]

Generated using TypeDoc

Type alias SessionInfo

SessionInfo: components["schemas"]["SessionInfo"]

Generated using TypeDoc

Type alias SnapshotContent

SnapshotContent: components["schemas"]["SnapshotContent"]

Generated using TypeDoc

Type alias SnapshotWithContext

SnapshotWithContext: components["schemas"]["SnapshotWithContext"]

Generated using TypeDoc

Type alias Special

Special: components["schemas"]["Special"]

Generated using TypeDoc

Type alias Stats

Stats: components["schemas"]["Stats"]

Generated using TypeDoc

Type alias SystemMessage

SystemMessage: components["schemas"]["SystemMessage"]

Generated using TypeDoc

Type alias SystemMessageChannels

SystemMessageChannels: components["schemas"]["SystemMessageChannels"]

Generated using TypeDoc

Type alias TwitchType

TwitchType: components["schemas"]["TwitchType"]

Generated using TypeDoc

Type alias User

User: components["schemas"]["User"]

Generated using TypeDoc

Type alias UserPermission

UserPermission: components["schemas"]["UserPermission"]

Generated using TypeDoc

Type alias UserProfile

UserProfile: components["schemas"]["UserProfile"]

Generated using TypeDoc

Type alias UserProfileData

UserProfileData: components["schemas"]["UserProfileData"]

Generated using TypeDoc

Type alias UserReportReason

UserReportReason: components["schemas"]["UserReportReason"]

Generated using TypeDoc

Type alias UserStatus

UserStatus: components["schemas"]["UserStatus"]

Generated using TypeDoc

Type alias Video

Video: components["schemas"]["Video"]

Generated using TypeDoc

Type alias VoiceFeature

VoiceFeature: components["schemas"]["VoiceFeature"]

Generated using TypeDoc

Type alias WebPushSubscription

WebPushSubscription: components["schemas"]["WebPushSubscription"]

Generated using TypeDoc

Type alias ClientOptions

ClientOptions: Partial<EventClientOptions> & {
    autoReconnect: boolean;
    baseURL: string;
    eagerFetching: boolean;
    partials: boolean;
    syncUnreads: boolean;
    channelIsMuted(channel: Channel): boolean;
    retryDelayFunction(retryCount: number): number;
}

Client options object

Generated using TypeDoc

Type alias Session

Session: {
    _id: string;
    token: string;
    user_id: string;
} | string

Generated using TypeDoc

Variable RE_CHANNELSConst

RE_CHANNELS: RegExp = ...

Regular expression for channels.

Generated using TypeDoc

Variable RE_MENTIONSConst

RE_MENTIONS: RegExp = ...

Regular expression for mentions.

Generated using TypeDoc

Variable RE_SPOILERConst

RE_SPOILER: RegExp = ...

Regular expression for spoilers.

Generated using TypeDoc